Welcome Guest, Not a member yet? Register   Sign In
login page and back button
#1

[eluser]deanf7[/eluser]
I have a login system that logs users in and out, but if you hit the back button in FireFox it will take the user back to the last page visited if the user clicks resend on the dialog box that pops up 'Firefox must send information that will repeat any action'. In IE it correctly re-displays the login screen


Code:
function log_off() {
    session_destroy();
    $this->session->sess_destroy();
    $this->session->set_flashdata('error', "<strong>You have been logged out.  It is recommended that you close your browser window/tab.</strong>");
    redirect('welcome/index', 'refresh');
    }

Obviously log_off isn't destroying the session or it's being recreated on the resend. Does anyone have any suggestions?

Thanks
#2

[eluser]pistolPete[/eluser]
I guess the problem is calling set_flashdata() after sess_destroy(). You probably have to manually unset the userdata because sess_destroy() only kills the cookie.

Have a look at
- http://ellislab.com/forums/viewthread/99612/
- http://ellislab.com/forums/viewthread/106522/
#3

[eluser]TheFuzzy0ne[/eluser]
You could call $this->session->sess_create() immediately after if you really need to clear the cookie. I decided to keep all of the data in the cookie apart from the details pertaining to the login (is_logged_in, username, user_id, admin_level).




Theme © iAndrew 2016 - Forum software by © MyBB