I'm using MySQL to build a session handler db. Part of my design is to kill off old sessions (10 minutes, 1200 seconds) as fast as possible.
I plan to 'require_once' a single PHP file for 1) my MySQL routines for the handler, 1) the session_set_save_handler setup for the routines, 3) and the correct sequence of calls to test the session for expiration.
I believe the following is correct, and would function as desired:
===============================
'stuff.php' pseudocode
function session_open;
function session_close;
function session_read;
function session_write;
function session_destroy;
function session_gc;
session_set_save_handler (all the routines above)
session_start();
{my code to test if the session already was open and has expired, if it has, destroy the session and divert the user with a 'header()' call to a "re-login" page, otherwise don't touch the session}
session_start();
============================================
I think I need the first call to session_start() to get all the session_handler stuff setup and working (load $_SESSION, etc). That way I can test the age of the session versus my limit in the next code.
The second session_start() probably isn't even necessary
anybody see a problem here?
Surfinbox.com Business Internet Services - National Dialup, DSL, T-1 and more.
I plan to 'require_once' a single PHP file for 1) my MySQL routines for the handler, 1) the session_set_save_handler setup for the routines, 3) and the correct sequence of calls to test the session for expiration.
I believe the following is correct, and would function as desired:
===============================
'stuff.php' pseudocode
function session_open;
function session_close;
function session_read;
function session_write;
function session_destroy;
function session_gc;
session_set_save_handler (all the routines above)
session_start();
{my code to test if the session already was open and has expired, if it has, destroy the session and divert the user with a 'header()' call to a "re-login" page, otherwise don't touch the session}
session_start();
============================================
I think I need the first call to session_start() to get all the session_handler stuff setup and working (load $_SESSION, etc). That way I can test the age of the session versus my limit in the next code.
The second session_start() probably isn't even necessary
anybody see a problem here?
Surfinbox.com Business Internet Services - National Dialup, DSL, T-1 and more.