Click here to Skip to main content
16,012,153 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I set session timeout for 2 minute
my timer trigger after every 1 min
i want to execute backend code on every 1 min if session exist
if user in idel mode for more than 2 min then redirect to login page


need help
Posted

1 solution

Use AJAX calls to the page on every one of those 1 minute event you have from the timer.
Perform actions on the server side when a call comes in.
Upon a return to the client side from AJAX you know that the session is alive.

Cheers,
Edo
 
Share this answer
 
Comments
tushar Vayangankar 12-Feb-13 0:36am    
actually i am developing an application for study
i want to store study time in database
if user just open page and do nothing i.e. if it is in ideal mode that time should not be added in database
Joezer BH 12-Feb-13 0:42am    
What do you plan to do when the user continues to study after the session ends?
tushar Vayangankar 13-Feb-13 1:27am    
he should login again

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