Redirect back to login page when BACK button is pressed?
Posted: Sun Jul 05, 2009 5:12 pm
I am having a logout.php page which successfully logs out the user destroying all the session variables. But when i use the Back button of the browser, I am still able to see the last page when the user was logged in.
How can i redirect a page to login page when a Back button from the browser is pressed, once the user has logged out?
Logout.php
<?php
session_start();
if (isset($_SESSION['username']))
{
ob_end_clean();
$_SESSION = array();
session_destroy();
header( 'Location: ../Index.php' ) ;
exit();
}
?>
Please tell me if there is a php function to redirect the back button press to login page !
How can i redirect a page to login page when a Back button from the browser is pressed, once the user has logged out?
Logout.php
<?php
session_start();
if (isset($_SESSION['username']))
{
ob_end_clean();
$_SESSION = array();
session_destroy();
header( 'Location: ../Index.php' ) ;
exit();
}
?>
Please tell me if there is a php function to redirect the back button press to login page !