I have two web applications hosted in two different virtual directories like (http://localhost/abc/default.aspx) and (http://localhost/xyz/default.aspx). In case of custom or Sql server Session mode, session variables are successfully shared between these
application (ASP.NET_SessionId is same for the two applications) , but in State server, sessions are lost. Machine keys are same for both. I have checked that ASP.NET_SessionId
is different for these two web applications. I have checked that ASP.NET_SessionId is same for these two web applications.
Web applications can store own session variables using the ASP.NET State Service.
Is it possible to use ASP.NET StateService for session sharing between these applications ?
When you use StateServer session state mode it may lost when your application in a load balanced Web farm environment. The application path of the Web site in the IIS metabase must be the same for all web servers in web farm.
I got ur point, but in my scenario there are two applications. (No Web Farm). First, web application (localhost/abc/login.aspx) is used for login and user management, and the second web application (localhost/xyz/module1.aspx) is for another module like
Stock Management. I want to share sessions between these two application. I can manage this session sharing using SQL /custom State mode.
But is it possible to share session using StateServer mode ?
Machine keys are same for both.I have checked that ASP.NET_SessionId is same for these two web applications. But for a session say Session["test"], values are different from these two applications.
hey there. I think state server sessions are domain-specific. I know there has to be some sort of workaround as many sites do use this but I'm not aware of it myself.
When the going get's tough, the tough outsource and take a vacation... lol I wish :(
i am also facing the same issue , can u guide me how did you solved it and how r u chking the session id in the xyz because it throws an error while retriving the session value and it says "object reference not set...."...
please help
Please click on Mark Answer if the solution satisfy you.
sagnikmukh
Participant
1850 Points
354 Posts
Share sessions between asp.net web applications using State Server
Jan 16, 2012 03:50 AM|LINK
I have two web applications hosted in two different virtual directories like (http://localhost/abc/default.aspx) and (http://localhost/xyz/default.aspx). In case of custom or Sql server Session mode, session variables are successfully shared between these application (ASP.NET_SessionId is same for the two applications) , but in State server, sessions are lost. Machine keys are same for both. I have checked that ASP.NET_SessionId is different for these two web applications. I have checked that ASP.NET_SessionId is same for these two web applications.
Web applications can store own session variables using the ASP.NET State Service.
Is it possible to use ASP.NET StateService for session sharing between these applications ?
DarrellNorto...
All-Star
86795 Points
9644 Posts
Moderator
MVP
Re: Share sessions between asp.net web applications using State Server
Jan 16, 2012 10:16 AM|LINK
Have you set the applicationName property? http://weblogs.asp.net/scottgu/archive/2006/04/22/Always-set-the-_2200_applicationName_2200_-property-when-configuring-ASP.NET-2.0-Membership-and-other-Providers.aspx
Darrell Norton's Blog
Please click "Mark as Answer" if this helped you.
sagnikmukh
Participant
1850 Points
354 Posts
Re: Share sessions between asp.net web applications using State Server
Jan 16, 2012 10:37 AM|LINK
In case AspNetSqlMembershipProvider, we can specify the applicationName.
<sessionState mode="StateServer" stateNetworkTimeout="30" stateConnectionString="tcpip=X.X.X.X:42424">
There is no option for applicationName. How do i set the applicationName for session state?
sirdneo
All-Star
15171 Points
2509 Posts
Re: Share sessions between asp.net web applications using State Server
Jan 16, 2012 01:01 PM|LINK
Applications are identified through machine key in state server. e.g.
If you use same machine key in multiple application then session will be shared
Zeeshan Umar
~Please Mark As Answer, one or multiple posts, which helped you. So that it might be useful for others~
sagnikmukh
Participant
1850 Points
354 Posts
Re: Share sessions between asp.net web applications using State Server
Jan 16, 2012 01:48 PM|LINK
Thanks for ur replies.
ASP.NET_SessionId is same for the two applications.
I have already mentioned that Machine keys are same for both the applications.
Qi Wu - MSFT
Contributor
5794 Points
677 Posts
Re: Share sessions between asp.net web applications using State Server
Jan 18, 2012 08:51 AM|LINK
Hi,
When you use StateServer session state mode it may lost when your application in a load balanced Web farm environment. The application path of the Web site in the IIS metabase must be the same for all web servers in web farm.
You can refer to the below link for more details.
http://support.microsoft.com/kb/325056
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
sagnikmukh
Participant
1850 Points
354 Posts
Re: Share sessions between asp.net web applications using State Server
Jan 18, 2012 09:01 AM|LINK
Thanks for ur reply.
I got ur point, but in my scenario there are two applications. (No Web Farm). First, web application (localhost/abc/login.aspx) is used for login and user management, and the second web application (localhost/xyz/module1.aspx) is for another module like Stock Management. I want to share sessions between these two application. I can manage this session sharing using SQL /custom State mode.
But is it possible to share session using StateServer mode ?
Machine keys are same for both. I have checked that ASP.NET_SessionId is same for these two web applications. But for a session say Session["test"], values are different from these two applications.
magicmike201...
Contributor
2021 Points
481 Posts
Re: Share sessions between asp.net web applications using State Server
Jan 19, 2012 02:40 PM|LINK
hey there. I think state server sessions are domain-specific. I know there has to be some sort of workaround as many sites do use this but I'm not aware of it myself.
neetugreat20...
Member
71 Points
38 Posts
Re: Share sessions between asp.net web applications using State Server
Feb 06, 2012 10:25 AM|LINK
have u solved this issue???
i am also facing the same issue , can u guide me how did you solved it and how r u chking the session id in the xyz because it throws an error while retriving the session value and it says "object reference not set...."...
please help
sagnikmukh
Participant
1850 Points
354 Posts
Re: Share sessions between asp.net web applications using State Server
Mar 02, 2012 09:34 AM|LINK
Hey guys .......... please confirm me whether it is possible or not ????????
