Click here to Skip to main content
14,493,463 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi,

I have a web application that is accessed by internal users using

http://coms/ . Now tehy decided to call this application home so users can access it using http://home/ . To make it transparent for users network admin added DNS redirect from coms to home. So if use types in http://coms it takes them to http://home . This is working fine but now I am facing issue with session variables. I have form based authentication and SSL enabled on the web pages. Once staff is logged in based on their role they will be redirected to their proper home pages. Everything works fine till this point and users are able to navigate within application properly. I have an Upload documents page which is not secured through SSL but users needs to upload documents through the application so whenever they click on that upload documents link the web page goes from https://coms/Staff/Details.aspx to http://coms/Upload.aspx. Just before redirecting user to Upload documents page I am setting one session variable Sessin["ID"]=somevalue. When I check that variable in Upload.aspx page it is showing null. The application was working perfectly fine right to the day we added DNS redirect from http://coms to http://home.

Here is the IIS bit :

http://COMS bind to 172.16.0.212
http://home bind to 172.16.0.212


Is DNS redirect doing cross domain redirect for every request ?

When I access the application through external website ( www.appname.com ) everything works perfectly fine. So my assumption is that redirect is killing session variable somehow. What is your point of view on this ?
Posted
Updated 8-Dec-10 10:01am
v2
Rate this:
Please Sign up or sign in to vote.

Solution 2

Unfortunately different domains are different applications with all respectful followings.
If this is only for users authentication and authorization I would recommend you to use the built-in membership.
In this case your members will be controlled by the single database and all the setting will be defined in the web.config
Good lick.
   
Rate this:
Please Sign up or sign in to vote.

Solution 1

you can't use same sessions on different domains
   
Comments
virang_21 8-Dec-10 15:46pm
   
I am not sure if DNS redirect is making every request a cross domain request ?
Rate this:
Please Sign up or sign in to vote.

Solution 3

Finally I resolved it. I made changes to IIS and rather than having two sites pointing to same directory I have one site pointing to the application with different DNS names and IP addresses. Now my IIS config for the application is like this :

Site name : COMS
Bindings :

http:// COMS bind to 172.16.0.212
http:// HOME bind to 172.16.0.213
http://www.appname.com bind to external link IP.

So basically three bindings with one site so one application pool.

DNS is doing redirect from COMS to HOME so all good now. No more issue with sessions. :laugh:
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100