Menu

#5 Logout message cannot be displayed

open
nobody
None
5
2011-09-07
2011-09-07
Anonymous
No

When the logout() function in the Auth controller is called, the _show_message() function is called to confirm to the user that they have been logged out. The _show_message() function sets a flashdata variable with the message to be displayed, then executes a redirect to the Auth controller's index function.

Because the tank_auth.logout() function is called previously, and the $this->ci->session->sess_destroy() function is called before that, there is no session in which to store the flashdata. Thus, anytime Auth.logout() is called, the Auth.index function cannot retrieve the flashdata and will always redirect to the Auth.login target.

I have only confirmed this behavior by commenting out each redirect function (in turn) and inspecting the ci_sessions database table, noting that the flashdata message is never readable.

Discussion


Log in to post a comment.