i need a timer that works like this :
imagine somebody have a limit time to do some actions, i can implement js and client side
code,but if the client closes the browser or my page,the timer will unloaded.
i need something that runs Independent of client action..
help me…
thanks…
You could save the start time in a database with an id attached to it. Then store that id in a cookie that expires long after your timer does in the client’s browser. That way you can keep track of the start time even if they close their browser. (But they could still delete the cookie).
When they send in a request use the cookie to lookup the start time from the database and take action if their time has expired.
If you need to process the timer even if the user doesn’t send in another request to the server you could set up a cron job that looks at the database for expired timers.