0

hey guys m tryin to make a log out page in my website but when the user clicks on the logout page the history does not get deleted. this means the user can still go back to the previous page.
Please help

4
Contributors
6
Replies
7
Views
9 Years
Discussion Span
Last Post by dickersonka
0

As told by others,

Use Session variables at the begining of each page to allow access .
If logout is needed, Destroy sessions and redirect to the login page.
Hope this solves the problem.

0

agree with kavitha

use this to destroy the session

session_destroy();

this to reset the cookie
if its cookie just set to its name

setcookie('nameofcookie');
0

This is the coding that I have used in my logout page....

<?
$past = time() - 100; 
//this makes the time in the past to destroy the cookie 
setcookie(ID_my_site, gone, $past); 
setcookie(Key_my_site, gone, $past); 
header("Location: main_login.php"); 
?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.