How to increase or decrease session timeout from other then web config file?
As in my schenario, I have to fix the session timeout for all user, but for some specific user I need to decrease it manually from code.
I tried to set the session timeout using below code but it did not work.
FormsAuthenticationConfiguration obj = new FormsAuthenticationConfiguration(); obj.Timeout = TimeSpan.FromMinutes(1);
On the Session_OnStart
event , you can call HttpContext.Current.Session.Timeout = 1;
as specified here: How can set different session timeout
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.