You can't really check whether a local cookie is expired or not. However, you can probably check the value of the cookie and see whether it's a valid value. For example, the user visits a page. It creates a simple local session cookie named "sess" with value "true", and 1 hour expiration date. Javascript can run a check on the "sess" cookie and see if the value is "true". If not, the cookie could be assumed to be expired.
Another method is to run a background polling script on the website. Basically it's a setInterval function executed every some time period (e.g. every 10 seconds) when the user is on the website, and it'll do an AJAX call back to the server with some data to updating the database regarding user's activity. If the last checked time period is over the interval period, you can assume that the user is no longer on the website. On Oct 31, 11:46 am, numerical25 <numerica...@aol.com> wrote: > In other words, is it possible to determine when a user has left the site or > his session has ended ?? > > numerical25 wrote: > > > I know I will more then likely have to download the plugin for cookies but > > I been doing research on how to listen for when the session expires but > > cant seem to find the issue. > > > Ive seen some examples where they set how long the cookie will last until > > it expires. But I would like to fire an event that will happen when the > > user leaves the site or when the session expires but I dont know where to > > start. anyone have any ideas. > > > Either for the plugin or anything at that. > > -- > View this message in > context:http://old.nabble.com/Jquery-Cookies-Or-Sessions-tp26140017s27240p261... > Sent from the jQuery General Discussion mailing list archive at Nabble.com.