How do i logout the session in another page?
This is the session:
<?php
// Initiate the session
session_start();
?>
<html>
<head>
<title>First Session</title>
</head>
<body>
<?php
// If the tracker variable is not registered, register it now.
if(!isset($_SESSION["tracker"]))
{
$tracker = 0;
session_register("tracker");
}
// Increment the tracker variable
$_SESSION["tracker"]++;
// Display basic session information up to this point
print("<br /><br />Tracker = " . $_SESSION["tracker"] . "<br />");
print("session_id =" . session_id() . "<br />");
?>
</body>
</html>
Now i want to logout the session in another page, for example logout.php
The script i have in logout.php are:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
// Unset all of the session variables.
session_unset();
// Finally, destroy the session.
session_destroy();
?>
<br>
you have successfully logout!
</body>
</html>
What should i add in both scripts/page? Thanks for helping!