I have started session (session_start()) in file which is included in all pages. My link for logout.php is in this file, i ll post code for included file later, also code for my logout.php page.
After i logout, its all ok, but if i click more then 2-3 times on my admin button (which should be active only if $_session['user1'] and $_session['pass'] r correct) i proceed to admin.php page (after i destroyed session o.O);
Part of my included file to all pages:
<?php
session_start();
if ((!isset($_SESSION['user1']))&&(!isset($_SESSION['pass1']))) {
echo "<li><a href='login.php'>Admin</a></li>";
}
else {
echo "<li><a href='Admin.php'>Admin</a></li>";
};
?>
logout page:
<?php
session_start();
unset ($_SESSION['user1'],$k);
unset ($_SESSION['pass'],$p);
session_destroy();
header('Location:Naslovna.php');
exit();
?>
exit()
necessary? – Kirk Powell