Phpbb sessions in my scripts
function sess_mysql_read($sess_id)
{
// read userdata from database and store it to $output
...
return($output);
}
function sess_mysql_write($sess_id, $val)
{
//!! $val is empty if isset($_COOKIE['phpbb2mysql_sid']) Why??? !!!!!
//receive $val, parse it and store to database
...
return(true);
}
session_set_save_handler("sess_mysql_open", "", "sess_mysql_read", "sess_mysql_write", "sess_mysql_destroy", "sess_mysql_gc");
session_name("sid");
// if phpbb started session use phpbb session_id if else use our session_id
if(isset($_COOKIE['phpbb2mysql_sid']))
{
session_id($_COOKIE['phpbb2mysql_sid']);
}
session_start();
$_SESSION['test'] = "ok";
echo $_SESSION['test'];
If user not logged to phpbb, $_COOKIE['phpbb2mysql_sid'] is empty
function sess_mysql_write receive $val
$val == 'test|s:2:"ok";'
Write to database session param 'test'
and script print
ok
If user login in phpbb
function sess_mysql_read
read userdata in $_SESION
function sess_mysql_write receive $val
$val == "" and store in database "null"
and script print:
ok
but(!!!) sess_mysql_write $val == "", $val is emty why???
Why function sess_mysql_write receive empty $val help my please!
PHP version 4.3.9