When I try to set flash data in a method it doesnt exist after a redirect. Here is an example:
function logout()
{
$this->session->set_flashdata('auth_msg', 'you have been logged out');
redirect('admin/login');
}
Problem is when I check for the value of auth_msg in flashdata, it doesnt exist and the user guide doesnt really show what method is bet to use when using this. What is the best method to use with what I am trying to do?
thanks
The reason is because flash data uses the session.
You have just destroyed the session on your
logout()function (I’m guessing).Therefore this is the one single place you cannot use flashdata in your application.
Try it somewhere else and it should work as you have coded.