Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: After session destroy, how to restrict 'Back' buttons


Message #1 by senthil_T_kumar@l... on Wed, 22 Jan 2003 08:43:48
> I implemented login/logout area using sessions. Its working fine. When the
> user logs out, I destroy the session. So, if he clicks on any link, it
> will ask him to login again. But I'm still able to browse through the site
> using back and forward button in the browser. Can anyone tell me how to
> avoid this?

You'll need to send the HTML headers to let the browser know to not cache the
pages.  I'm not absolutely sure, but I think that these should do it:

  header('Expires: 0');
  header('Cache-Control: must-revalidate, post-check=0, pre-check=0');


Take care,

Nik


  Return to Index