Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all
Automatically log out from 12:00 – 12:30
Posted
Updated 15-Jun-11 2:58am
v2
Comments
Sandeep Mewara 15-Jun-11 8:26am    
Elaborate more: Using what mechanism you keep track of login? Session?

1 solution

Hey I found this link-[Implementing Auto-Logout functionality][^] which might be useful for you.
enegadeMind gives perfect answer
1) Save the time-stamp of every request( server and ajax excluding the session check ajax request) to the server into a session var.
2) Poll the server via a JS function using ajax at frequent intervals and check if the time diff between the session time-stamp and the ajax request time is greater than the session timeout val then log-off the current user and return a bool for that ajax request.
3) Redirect the current page to the login page if the bool returned is true.
 
Share this answer
 
Comments
Ra-one 15-Jun-11 9:32am    
perfect solution ....... my 5
RaviRanjanKr 16-Jun-11 0:04am    
Thanks :)
thatraja 15-Jun-11 10:06am    
Good, 5!
RaviRanjanKr 16-Jun-11 0:04am    
Thanks Raja :)

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