RE: [PHP-DEV] session problems with own session handler in php..
| From: | Jaime Bozza | Date: | Fri, 18 Jan 2002 16:31:25 +0000 |
| Subject: | RE: [PHP-DEV] session problems with own session handler in php.. | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-77448@lists.php.net to get a copy of this message | ||
Robin,
That's your problem. (Or, at least one of the problems.) PHP has a
bug where returning "false" from session_read causes all sorts of
strangeness. Change "return false;" to "return '';" and your problem
will likely go away.
Jaime Bozza
-----Original Message-----
From: Robin Ericsson [mailto:lobbin@localhost.nu]
Sent: Friday, January 18, 2002 8:01 AM
To: Jaime Bozza
Subject: RE: [PHP-DEV] session problems with own session handler in
php..
On Fri, 2002-01-18 at 14:55, Jaime Bozza wrote:
> Robin,
> Can you check your session_read handler and tell me what value
> you're returning when there isn't any data yet?
Sure, here you go:
function session_db_read ($key)
{
global $g_objSQL;
$res = $g_objSQL->Query("SELECT session_data FROM
sessions WHERE session_id = '".$key."'");
if ($res->NumRows() > 0)
{
$row = $res->FetchRow();
return stripslashes($row[0]);
}
else
{
return false;
}
}
$g_objSQL is a SQL class I wrote
regards
Robin