When You use InProc, all Session state is stored in memory. But when the application pool recycles, all session states are lost. So when session is lost at irregular intervals, most likely, your applicatiion pool recycles, so you have to identitfy why that
happens. The next article explains some reasons...
If you want to use InProc sesison mechanism which is default, you need to configure onl one worker process in application pool and you disable load balancing of server. (web farming).
KunalVishwak...
Member
21 Points
49 Posts
session timed out even user working on page
Feb 24, 2012 07:11 AM|LINK
Hi,
I have a website running on sbs win 2003 server. dedicated in my office. website is developed in .net 2.0 with IIS 6.
When i use 'InProc' state, my users (200-300 dedicated users) are getting ogged off at every 5 minutes (not exatly).
but whien i use 'SQLServer' state, then there is no problem. but website gets slow, and i need to restart sqlservice with sql server agent.
Now I want to use 'InProc' state. how do I do it ?
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks,
Kunal
atulthummar
Participant
1612 Points
389 Posts
Re: session timed out even user working on page
Feb 24, 2012 07:35 AM|LINK
Hi
you can either do it in web.config file Here the timeout "20" is in
minutes if u want u can change in to fit your requirement.
Web.Config
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
or in the session_start of global.asax
protected void Session_Start(Object sender, EventArgs e)
{
Session.Timeout = 20;
}
Atul T.
Please click "mark as answer" if this post helped you.
hans_v
All-Star
35986 Points
6550 Posts
Re: session timed out even user working on page
Feb 24, 2012 09:00 AM|LINK
When You use InProc, all Session state is stored in memory. But when the application pool recycles, all session states are lost. So when session is lost at irregular intervals, most likely, your applicatiion pool recycles, so you have to identitfy why that happens. The next article explains some reasons...
http://petesbloggerama.blogspot.com/2007/10/losing-aspnet-sessions-why-application.html
roopeshreddy
All-Star
20155 Points
3328 Posts
Re: session timed out even user working on page
Feb 25, 2012 03:39 PM|LINK
Hi,
Instead of InProc, you can use StateServer mode!
It's a separate ASP.NET State service, which is better than SQL Server!
NOTE: ASP.NET State service should be started!
Hope it helps u...
Roopesh Reddy C
Roopesh's Space
satalaj
Star
10505 Points
2031 Posts
MVP
Re: session timed out even user working on page
Feb 26, 2012 12:34 PM|LINK
Hi,
It seems you have configured the IIS to use multiple worker process to server the request. In this case you must store session out of proc.
http://revenmerchantservices.com/post/session-loss-in-webgarden.aspx
If you don't want to use SQL session state storage mechanism, you can use Asp.net state server. It's faster as compared to SQL server.
http://www.satalaj.com/2011/12/session-state-server.html
Visit: Working with session .
If you want to use InProc sesison mechanism which is default, you need to configure onl one worker process in application pool and you disable load balancing of server. (web farming).