Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Sep 14, 2012 04:18 AM by apphkbruce
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 ?
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
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?
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
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.
Jan 18, 2012 08:51 AM|LINK
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.
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.
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.
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...."...
Mar 02, 2012 09:34 AM|LINK
Hey guys .......... please confirm me whether it is possible or not ????????