Last post Jan 12, 2012 12:16 AM by kirupa.v
Jan 06, 2012 04:41 AM|frvdm|LINK
Anyone who has experience on setting session timeout?
I'm using a login control for authentication and I've set in my web.config the timeout on 60 minutes as follows:
But everytime, when I'm logged in, after 20 minutes (not 60!), I'm redirected to the login page again
What's wrong here?
Thx in advance
Jan 06, 2012 04:58 AM|mahajan344|LINK
You would have to setup session timeout in your IIS.
or if you have hosted online..then go to configration setting of the domain..
you will see timeout ..that will work.
Jan 06, 2012 05:27 AM|hans_v|LINK
I'm using a login control for authentication
Do you mean you're using forms authentication? Then you need to realize that forms authentication has nothing to do with Session, so increasing Session timeout is not the solution. You need to reset the
FormsAuthentication.Timeout property, which has a default value of 30 (minutes).
This doesn't mean that when you set this timeout property to 60, that you remain logged when you make a new request within 60 minutes:
Sliding expiration resets the expiration time for a valid authentication cookie if a request is made and more than half of the timeout interval has elapsed
So if you loggin, wait for 29 minutes and make a new request, the expiration time of the cookie is nit reset. So when you make the next request after 32 minutes, you are redirected to the login page....
Jan 06, 2012 01:18 PM|Pradeep Kr. Sharma|LINK
Change Session value in IIS which is by default 20 minutes. Session value can be change in below three ways
1. In Web.config like.. <sessionState mode="InProc" timeout="60" cookieless="true" />
2. In C# Code you can set timeout like...... Session.TimeOut=60;
3. In IIS Setting, If your application is running on the IIS then check the session timeout inside the IIS setting
where the default session time out is 20 Min. Change that according to your requirement.
Follow are the steps to change the default session time in IIS. 1. Click on Start --> RUN --> type INETMGR and press enter. 2. Navigate to your application node, right click on it and then select "Properties". 3. In the 'Directory' tab click "Create" button, then click "OK". 4. Click on the "Home Directory" tab, then "Configuration". 5. Click on the "Options" tab. 6. Increase the "Session timeout" value and click "OK".
Jan 08, 2012 12:26 AM|Mushfiq_bd|LINK
Go to IIS -> Application Pool -> Properties -> Performance and increase the Recycle worker processes to 60 minutes.
Jan 11, 2012 11:59 PM|sirdneo|LINK
There are different options to set session time out in your application. For Details see:-
How to set Session Timeout in ASP.Net
If you set timeout as mentioned in above article and still you are loosing session before time or loosing session randomly then it might be because of server restarts. For details see:-
Why .Net sessions are terminated/loss unexpectedly
Jan 12, 2012 12:16 AM|kirupa.v|LINK
Refer the following links