I have problems with correct implementation of user defined session handling. For my indvidual session handler I use a standard class [1] which stores session data in the database.
In a first page everything works as expected. I start a new instance of the class (which define the and initalize the session_set_save_handler functions), and use $_SESSION[] to write some content to the db
Code: Select all
<?php
require_once 'DB.php';
require("sessionclass.php");
//... start dB connection
$session = new session($nikaDb);
session_start();
$_SESSION['hello']="dsadsa";
$_SESSION['hello2']=432432143;
echo session_id()."<pre>".print_r($_SESSION,true)."</pre>";
?>So when I switch from the first page to the second, the session_id is both the same, and the dB tabel is still filled with the 'hello' and 'hello2' vars, but when I try to print out the session (e.g $_SESSION['hello'] or print_r($_SESSION)), it is empty.
Have I misunderstood the session concept ? Can't I simply recall a value with $_SESSION[''] like i do it with the default session handler ? How can I recall the values ? Thx _yak
[1] http://www.nika.at/test/session_handler/session.html