Knowledgebase
ASP.NET Session state peridocally lost.
Posted by Jonathan Hughes on 13 October 2007 12:42 PM
ASP.NET session data is periodially lost:

Symptoms: Users are required to login continuously or session data is lost peridocally in asp.net applications.

Cause: When using InProc mode to store sessions, (the default unless specified in your web.config), session data is stored in the sites application pool. This is prone to recycling when memory or processing time limits are hit., losing session data.

Resolution: Change the way that sessions are stored for your application. It is possible to use the Session State server or your SQL database to store sessions. Below is an example of what to add to your web.config to change the session state mode.

<configuration>
<sessionstate
mode="stateserver"
cookieless="false"
timeout="20"
sqlconnectionstring="data source=127.0.0.1;user id=<user id>;password=<password>"
server="127.0.0.1"
port="42424"
/>
</configuration>

http://msdn2.microsoft.com/en-us/library/ms972429.aspx

(1223 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).