views:

41

answers:

2

Hi,

Can you guys let me know for how long the session values will be available when the mode is state server? Thanks!

A: 

It will store it until ASP.NET state service i.e your state server is running....so it will be lost if you restart it...more information here - http://msdn.microsoft.com/en-us/library/ms178586.aspx

Misnomer
+1  A: 

The session values will be lost on restart of the application which can be cause by a lot of things (web.config change , iisreset, rebooting the box)

The session values will also be removed when the session ends. By default I think its 20 minutes of inactivity

<sessionState mode="StateServer"
      stateConnectionString="tcpip=SampleStateServer:42424"
      cookieless="false"
      timeout="20"/>
Conrad Frix
I see. But in my case, I have two websites (on my local development machine) belonging to the same domain [One is the main site and the other one is the subdomain]. Am not able to access the session values between these two sites. Any idea on what might be going wrong here? Thanks!
That's a much different question. The short answer is you can't. You may only access the HttpContext.Session that's in the System.AppDomain that your code is currently accessing. You can however share cookies for the websites you describe. You can use that to roll your own cross-AppDomain session state.
Conrad Frix
I see. Ok. Will try out a bit and get back if I have further questions. Thanks a lot!