[eluser]kevinh21[/eluser]
Hi Yash
Thanks for your answer but i think you misunderstood me.
The if-code is working fine, i think i should make it a bit more understandable by reducing the code:
function settings()
{
$this->session->set_flashdata('status', 'You must be logged in to view this page');
echo 'TEST'.$this->session->flashdata('status');
}
This part is making the problem.
Sometimes when i execute this function by browsing to localhost/admin/settings or clicking a link that refers to this, it will only write "TEST" and the session flashdata in 'status' seems not to be set.
When i reload the page, it will write "TESTYou must be logged in to view this site".
I don't understand why it sometimes doesn't have set this flashdata.
Most of the times this is the case after i executed other functions.