Inconsisteny problem with HTTP_Session 0.4
| From: | Torsten Roehr | Date: | Sun, 08 Feb 2004 00:43:12 +0000 |
| Subject: | Inconsisteny problem with HTTP_Session 0.4 | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-10547@lists.php.net to get a copy of this message | ||
Hi,
I'm using HTTP_Session 0.4 with the PEAR::DB container and experience a
strange inconsistency problem. Sometimes the session data just gets lost
although the session is not expired. I've tested my expiry check
successfully with a session limit of a few minutes and than set the value to
4 hours for the production environment (it's not a high-security website).
I've set idle time to 0 to avoid it being checked.
Here's my code:
>>>
// set session parameters and start session
ini_set("session.use_trans_sid", "0");
HTTP_Session::useCookies(false);
HTTP_Session::setContainer("DB", array('dsn' => $dsn, 'table' =>
TABLE_SESSIONS, 'autooptimize' => true));
HTTP_Session::start("s");
HTTP_Session::setExpire(14400);
HTTP_Session::setIdle();
// if auth object exists in session set global reference
if (is_a(HTTP_Session::get("auth"), "Auth"))
{
$auth =& HTTP_Session::get("auth");
}
// else init and store new auth object in session
else {
$auth =& new Auth();
HTTP_Session::set("auth", $auth);
}
//if session is expired destroy session and redirect to start new session
if (HTTP_Session::isExpired())
{
HTTP_Session::destroy();
header('location: ' . $_SERVER['PHP_SELF']); exit;
}
<<<
I know that this is not a lot of information to work with but maybe some of
you have experienced a similar situation. Has anyone used the package with a
session limit of as long as 4 hours?
Any hints appreciated!
Best regards,
Torsten Roehr