I have Admin Page wherein I use to do some update work for my site. The problem is the session will expire within a minute or 30 seconds and will logout the user. I have set the Session in Web.Config of the root folder as well as in the Web.Config inside the Admin folder but still the session gets expired soon. I have set it to 60 minutes but it only lasts for 30 seconds or within a minute. Here is my web.config content of root folder
<sessionState timeout="60" mode="InProc"
cookieless="false"></sessionState>
<customErrors mode="Off">
</customErrors>
<trace enabled="true" />
<authentication mode="Forms">
<forms
protection="All"
timeout="120"
domain="www.marpallichande.in"
slidingExpiration="true"
name="auth_cookie" />
</authentication>
and this is my setting of web.cofing file inside the Admin folder
<sessionState timeout="60" mode="InProc"
cookieless="false"></sessionState>
and this is my setting in Global.asax file under Session_Start method
Session.Timeout=60;
I am not getting how the session is getting expired so soon or is there any other reason for been getting logged out other than session.
To enable in-process session state by using the UIOpen IIS Manager and navigate to the level you want to manage. In Features View, double-click Session State. On the Session State page, in the Session State Mode Settings area, click In process.
The SessionStateSection class refers to the element in the Machine. config or Web. config configuration file identified by the sessionState tag.
InProc session mode indicates that session state is stored locally. This means that with InProc session state mode is stored as life objects in the AppDomain of the Web application. This is why the session state is lost when Aspnet_wp.exe (or W3wp.exe, for applications that run on IIS) or the AppDomain restarts.
sessionState timeout value is in minutes. I would start by removing Session.TimeOut (and any other timeout values except sessionState timeout, leave it as it is and give it a try. Also, not sure why you have two config files? Do they have same settings?
I have a similar setup but just one config file with
<sessionState mode="InProc" cookieless="false" timeout="10" />
setting it to 10 minutes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With