[eluser]DrWaky[/eluser]
[quote author="WanWizard" date="1309317695"]No issues with flashdata here. If you create this test controller
Code:
class Flashdata extends MY_Controller {
function __construct()
{
parent::__construct();
$this->load->library('session');
}
function index()
{
if ($var = $this->session->flashdata('test'))
{
echo "Found data: $var";
}
else
{
$this->session->set_flashdata('test', 'flash data test');
echo "Set data";
}
}
}
you'll see that it alternates between found and set, as designed.
You could have a flashdata issue if you use cookie based sessions (which you should not), use Internet Explorer, and redirects. Some IE versions ignore headers when they see a 'location' redirect in the header, which in case of session cookies means you lose that session update...[/quote]
But in this code the if
Code:
if ($var = $this->session->flashdata('test'))
works because it assign FALSE (an strange value of $this->session->flashdata('test')) to $var so, the calculated value to if condition is TRUE, so it work, cause the asignation in condition work fine
Try an echo of $var after de asignation please to see its content.