Session Timeout

hey there i have a problem, a major problem, with intermittent timeouts on my site. im using aspx pagges and the timeouts seem to come randomly. am i wrong here or should a time out only happen when a page is left idle for n-minutes? because its not making sense to me

heres my line from the web-config:

<sessionState mode="InProc" stateConnectionString="tcpip=" sqlConnectionString="data source=;user id=sa;password=" cookieless="true" timeout="20" />

thanks! please help its URGENT!!
Who is Participating?

Improve company productivity with a Business Account.Sign Up

ahmedrashidConnect With a Mentor Commented:
One of the things that causes the session to expire is if the bin folder of the project is opened. So first please make sure that doesent happen. Also if the project solution on the server is build even that breaks the session.

Also you can check out these links:
another link that might be helpful.
The following links might be helpful:

The session timeout will also occure if ASP.Net Worker process aspnet_wp.exe is restarted because of the server settings.
Rashid is also correct and if you build the project and transfer the updated dll to the bin folder the session will also restart. The same is true when you will edit the web.config file.

HTH, Nauman.
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

The bottom line is as of the current framework implamentation session is not bulletproof, follow the articles for help on tweaking, but realize the underlying truth.


Are you clearing the session variables anywhere in ur code ? Please be very careful doing that. What method are you using ?

    Do you have an anti-virus software installed??
    Disable that or configure it to NOT SCAN .asax and .config files.

Session data maybe lost intermittently because of antivirus software activity.
This problem can occur when antivirus software scans the Web application files. During the scanning process, the antivirus software may mark the Global.asax, the Web.config, and/or the Machine.config files as modified. This modification prompts the Microsoft .NET Framework to restart the Web application.
If the session data is stored in-process, all session data is lost whenever a Web application is restarted.

Here's the MSDN link for the suggested solution as above..

PRB: Session variables are lost intermittently in ASP.NET applications;en-us;Q316148%20
I'd just like to adress Nauman Ahmed if I may> I do appreciate you agreeing with my point but please understand that my name is Ahmad and not Rashid as you wrote.
Thank You.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.