Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is it possible to extend the session time out for two different user?example for admin timeout is 20 min and for other user it is 10 min.
Posted

Yes . You can set the session time explicitly for user types

Try
C#
protected void SetSession(string userType)
{
    if (UserType == "admin")
    {
        Session.Timeout = 20;
    }
    else
    {
        Session.Timeout = 10;
    }
}


Hope this helps...
 
Share this answer
 
v2
Comments
Karthik_Mahalingam 24-Dec-13 5:29am    
5
JoCodes 24-Dec-13 9:16am    
Thanks Karthik
utm 24-Dec-13 6:52am    
new problem arises How to Check whether Session is Expired or not ?
Hi,

Please see the below link. It will help you.
you can do session time out roles wise as well.

http://forums.asp.net/p/1944887/5540809.aspx?How+to+maintain+session+timeouts+by+different+login+wise+in+an+application[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900