[eluser]must[/eluser]
hi,
by writing
Code:
$this->login->logout(;) // Library file
$this->session->keep_flashdata(‘message’);
first
Code:
$this->login->logout(;)
should be (you should have a syntax mistake showing up if you wrote this in your logout function)
Code:
$this->login->logout();
seconde you're trying to keep a flashdata after destroying the session (wich should destroy flashdata as well) and a new session won't be created until the user goes to another page (by redirect).
the only way to do this that i can come up with is:
Code:
check_login_session() /config/check_login_session
{
if($this->CI->login->is_logged_in())
{
if($session_life > $inactive)
{
$this->CI->session->set_flashdata(‘message’, ‘your session has expired, please login again.’);
$this->CI->session->set_flashdata(‘sess_expired’, 'TRUE');
redirect(‘user/login’);
}
}
}
and in you're user controller / login method add somehing like
Code:
if($this->session->flasdata('sess_expired'))
{
$message = $this->session->flashdata(‘message’);
$this->login->logout(); // or $this->CI->session->sess_destroy();
echo $message;
}
bottom line you can't use the flashdata for this. I hope this helped you.