In CodeIgniter, how to clear "form data" after redirecting page

Posted by Obay on Stack Overflow See other posts from Stack Overflow or by Obay
Published on 2010-06-03T15:00:20Z Indexed on 2010/06/03 15:24 UTC
Read the original article Hit count: 314

Filed under:
|
|
|

I'm not sure I explained it correctly in the question title, so here's the details:

Login controller:

function authenticate() {
    if ( authorized ) {
        redirect('lobby');
    } else {
        redirect('login');
    }
}

Lobby controller:

function index() {
    //load lobby view
}

What happens is that in the login page, I enter user / pass, click Login, then authenticate() is called, and redirects me to the Lobby.

However, when I click refresh while on the Lobby, the login form gets submitted again, so I get "logged in" again. How do I prevent that from happening?

© Stack Overflow or respective owner

Related posts about php

Related posts about mvc