Last post Nov 24, 2014 08:55 AM by 0belix
Nov 24, 2014 06:06 AM|Mrutyunjaya|LINK
I have developed a web application which i have hosted in iis 7 ..
But I have a problem of session timeout within 20 minutes of application starting.
I already set timeout value in web.config file as 540 minutes & also in IIS server in
SessionState Properties to 540 minutes & also the Idle timeout to 540 minutes .
Can anyone suggest me any solution why this problem is occuring ?
Nov 24, 2014 07:52 AM|AidyF|LINK
Does it work ok if you try something lower, like 400?
Nov 24, 2014 07:58 AM|Mrutyunjaya|LINK
I have not tested with value 400..
but it is expiring after 15 minutes actually...
Nov 24, 2014 08:01 AM|Rion Williams|LINK
Did you set the Forms Authentication timeout as well as it's the only timeout that I can think that you didn't mention.
Setting the Forms Authentication Timeout within your web.config
You can adjust the specific timeout property of your Forms Authentication in your application by adjusting the timeout property within the <authentication> element of your web.config file. You will also want to be mindful that if you are using the slidingExpiration
property in conjunction with timeouts as they can actually expire much earlier than the timeout listed.
<authentication mode="Forms"> <forms name=".ASPXAUTH" loginUrl="~/Login.aspx" timeout="yourTimeoutInMinutes"></forms> </authentication>
So if you wanted to extend the amount that the authentication token stays "alive" for to say 540 minutes, you would set it as seen below :
<authentication mode="Forms"> <forms name=".ASPXAUTH" loginUrl="~/Login.aspx" timeout="540"></forms> </authentication>
However, if you are using the slidingExpiration property, the authentication token can expire when half of the timeout duration has elapsed. So you'll likely want to double your timeout value if you are using it :
<authentication mode="Forms"> <forms name=".ASPXAUTH" loginUrl="~/Login.aspx" timeout="1080" slidingExpiration="true"></forms> </authentication>
Nov 24, 2014 08:05 AM|Mrutyunjaya|LINK
No Sir ,I have also set the value as u mentioned above in my web.config but nothing is working out.
Nov 24, 2014 08:07 AM|Mrutyunjaya|LINK
I am not using sliding expiration..
Nov 24, 2014 08:09 AM|AidyF|LINK
Try a smaller value, as it might be defaulting to 15\20 mins as the value you've given is too large. Also if this is a live site, check the event viewer for app recycles as the app will recycle under various conditions such as memory usage getting too large
Nov 24, 2014 08:10 AM|Mrutyunjaya|LINK
How to check event viewer for app recycles..
Nov 24, 2014 08:15 AM|Rion Williams|LINK
If you have all of the time-outs properly set to 540 minutes, you shouldn't be experiencing any types of time-outs (either Authentication, Idle or Session) within 20 minutes. 20 minutes is generally the default for an idle timeout within IIS, so
I am leaning towards that not being properly set.
As Aidy mentioned, I would recommend going through the IIS Logs or looking through the Event Viewer on the server to see if you see any indications of what the issue could be caused by.
Nov 24, 2014 08:16 AM|AidyF|LINK
Nov 24, 2014 08:30 AM|kaushik_tatva|LINK
Nov 24, 2014 08:41 AM|Mrutyunjaya|LINK
I viewed the event viewer for log entry
it shows Application Error.
Faulting Application name : w3wp.exe
Nov 24, 2014 08:55 AM|0belix|LINK
Instead of SessionState mode="InProc" use SessionState Mode="StateServer", but you'll need to make sure the server where you're hsoting the application has the StateServer active.
This will no longer result in the session ending up before the time you set