Securing a Webpage: User Must Login

I have a problem with my webpage secure script. Even after logout, wen I hit the back button on my browser, I can still access the secure page. I can still even access the assigned page without login instead of redirecting to “login.php”. I don’t know what might be wrong with the variable or scripting. I have tried the “||”, “&&” and “or” variable and it work. Here is the secure page script.

<?php //Start session session_start(); //Check whether the session variable SESS_MEMBER_ID is present or not if(!isset($_SESSION['login']) xor (trim($_SESSION['login']) == '')) { header("location: login.php"); exit(); } ?>

Here is the logout out script :

<?php session_start(); session_destroy(); //you can change index.php with any url header( 'Location: index.html' ) ; ?>

Please I need to get this resolve ASAP. Thanks in anticipation.

I’m not quite sure what you are trying to do; please give more code and tell us of which file is which… :undecided:

Sponsor our Newsletter | Privacy Policy | Terms of Service