[eluser]pdriessen[/eluser]
I made the follow test controller:
Code:
<?
class Test extends Controller {
# START INDEX
function index()
{
$this->load->library('session');
echo "</br>session_id: ";
echo $this->session->userdata('session_id');
echo "</br>test_key: ";
echo $this->session->userdata('test_key');
$this->session->set_userdata('test_key', 'test_value');
echo "</br>session_id: ";
echo $this->session->userdata('session_id');
echo "</br>test_key: ";
echo $this->session->userdata('test_key');
} # EINDE INDEX
}
?>
when I open this file I get this output:
Code:
session_id: 100c0ab06df21aeaa2e4b183ebb22fa8
test_key:
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/shoppeni/_si/system/application/controllers/beheer/test.php:10)
Filename: libraries/Session.php
Line Number: 662
session_id: 100c0ab06df21aeaa2e4b183ebb22fa8
test_key: test_value
The output and the error message are correct. The only problem is that when i refresh the page, I get a new session_id number and the previous set test_key had gone...
Anybody knows what I do wrong?