Jump to content

Recommended Posts

Here is what I want to do - when the user uses the page the session is created. As soon as the user closes the page I want to catch that moment and perform last second things like committing data to DB, writing logs, etc. So how so I catch the fact that the user broke the session?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/56478-detect-that-session-in-broken/
Share on other sites

That would be a bit creepy if you could know when ever a user left your site.

 

You can, however, log the last time a session was active such as when a user loads a page, and then use that information to expire sessions if the last action was >= X seconds ago.  Then you could do some logging with that stuff (I think that's how SMF knows how long you've been on the boards), but you could not, for example, get where a user went when leaving your site (unless you had dynamic links and they followed one).

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.