Jump to content

Update MySQL Database When Session Ends


RTS

Recommended Posts

yes, but you'll have to write your own session handling functions for all session related options. See
http://ca.php.net/manual/en/function.session-set-save-handler.php

There's even an example there for file-based sessions which you might want to extend. You'll want to put your database update in the _close and/or _gc functions.
I've never done this before, but it looks like you define functions with the same names as these:

session_set_save_handler("open", "close", "read", "write", "destroy", "gc");

Then when named action occurs, it runs that function.  You would have to include this file on all of your pages, likely before you do session_start();

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.