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

[eluser]Mimi kesini[/eluser]
need help... :'(

I've tried using the sessions class, add the session data in the database and I added a header in the view but the results still, I can access the previous page by pressing the back button.

my controller
Code:
$data = array(
        'Username' => $this->input->post('Username'),
        'is_logged_in' => true );
$this->session->set_userdata($data);

my view header
Code:
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate, no-transform, max-age=0, post-check=0, pre-check=0" />
<meta http-equiv="pragma" content="no-cache" />

my logout function
Code:
function logout()
{    
   $data = array($this->session->unset_userdata('Username'),  
                 $this->session->unset_userdata('is_logged_in'));
   $this->session->sess_destroy($data);
   redirect('login','refresh');
}

I use mozilla as a browser


Thank you... Smile
#2

[eluser]gyo[/eluser]
This is a common issue which has nothing to do with CodeIgniter or the Sessions class.
Basically when you hit the back button on the browser, it gives you the cached page without re-asking it to the server.
It's supposed to work like that.

Try to search for "back button" here in the forum to get more info about it.
Also try loggin to whatever website (amazon, ebay, facebook) and you'll notice the same "issue".
#3

[eluser]Nick_MyShuitings[/eluser]
Also remember, that even though they can see the page, they will not be able to interact with it in any way.

One thought, its something that Facebook does to make life miserable for crawler bots, but you can load important parts of the page with AJAX, using a lazyload that triggers on page ready. the Back button cache usually only covers what is initially downloaded and as such, if your ajax php side is well written, they won't get any content.
#4

[eluser]Nick_MyShuitings[/eluser]
Check out this thread and wanwizards comments : ie use headers instead of metas

http://ellislab.com/forums/viewthread/155733/




Theme © iAndrew 2016 - Forum software by © MyBB