[eluser]CodeIgniteMe[/eluser]
[quote author="Vheissu" date="1310665546"]I am experiencing the exact same issue. I created a test controller setting a session value, reloading the page to see it's no longer set.
Try the following code in a controller called 'test.php' and reload the page a couple of times and see what happens.
Code:
<?php
class Test extends CI_Controller {
public function index()
{
if ( $test = $this->session->userdata('test') )
{
echo "Session found, value stored was: ",$test;
$this->session->unset_userdata('test');
}
else
{
echo "Empty session, setting a test variable";
$this->session->set_userdata('test', 'value');
}
}
}
[/quote]
I tried the code, and the output was:
Quote:Empty session, setting a test variable
and after one refresh,
Quote:Session found, value stored was: value
and after another refresh, the former result was outputted and so on...