ADODB store session to database
| From: | weetat | Date: | Wed, 07 Jun 2006 09:34:21 +0000 |
| Subject: | ADODB store session to database | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-237545@lists.php.net to get a copy of this message | ||
Hi all ,
I am having problem in store session in the database . Below is the example code from code.
The issue is that the code run ok , however the expireref fields is not updated in the sessions table, below is the sessions schema :
CREATE TABLE
sessions (
sesskey varchar(32) NOT NULL default '',
expiry int(11) unsigned NOT NULL default '0',
expireref varchar(64) default '',
data longtext,
PRIMARY KEY (sesskey),
KEY expiry (expiry)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
Anybody have ideas why all fields are updated except expireref field ?
<?php
function NotifyExpire($ref,$key)
{
print "<p><b>Notify Expiring=$ref, sessionkey=$key</b></p>";
}
$ADODB_SESSION_DRIVER='mysql';$ADODB_SESSION_CONNECT='....'; $ADODB_SESSION_USER ='....'; $ADODB_SESSION_PWD ='....'; $ADODB_SESSION_DB ='....'; $ADODB_SESS_DEBUG = 99;
session_start();
$userdata = new User();
$_SESSION['USER_NAME'] = $userdata->getUsername();
$ADODB_SESSION_EXPIRE_NOTIFY =array('USER_NAME','NotifyExpire');
ob_start();
include('./library/adodb/session/adodb-cryptsession.php');
adodb_session_regenerate_id();
$_SESSION['MONKEY'] = array('1','abc',44.41);
if (!isset($_GET['nochange'])) @$_SESSION['AVAR'] += 1;
?>