Anybody have any problems with session_start() not loading the $_SESSION variable on rare occassions when using MySQL to store the sessions?
I don't want to bore you with the details, the code works 99.9% of the time. One out of about every 1000 page loads, $SESSION will be either empty array or only two or three of the SESSION variables will be loaded, which causes my users to be logged out (if the $SESSSION['username'] and $SESSION['password'] vars are not set, user gets logged out). I have been struggling to solve this problem for some time. If you have ever heard of this, I would be happy to hear your thought.
//... inside of a class function ....
function mySession($id=false)
{
$this->PEAR();
$this->fDB = $this->getDBConnection();
// set up session manager and start session
session_set_save_handler( array( $this, 'sessOpen' ),
array( $this, 'sessClose' ),
array( $this, 'sessRead' ),
array( $this, 'sessWrite' ),
array( $this, 'sessDestroy' ),
array( $this, 'sessGC' ) );
if ($id)
session_id($id);
session_start();
$this->fID = session_id();
}
// .... rest of class function