Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
how can i set different session timeouts based on the user type. for example i want to set session timeout of 40 mins to admin and 20 mins for investor. Any one please help me..
Posted
Updated 16-May-13 23:55pm
v2

You can manually set Session.Timeout property based on user type.

You can call Session.Timeout property after user successfully logs in.
 
Share this answer
 
In that case, one approach - separate admin and investor pages into different virtual directories but in the hierarchy of same parent. In the child Directory, override the web.config settings of parent as required.

Another approach - Depend on Javascript which checks 20mins/40mins time out based on his role into aspx, Irrespective of server session time, you will call session.abandon for the role prematurely.
But web.config should have session time out ( max(time) of all roles) as MAX of all role timeouts..

Hope it helps!
 
Share this answer
 
We need to implement the Session.TimeOut Functionality for the given user at runtime while authorizing them
 
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