Forum Moderators: coopster
My Logout.php code is
<?php
include("../../includes/session_check.php");
sessioncheck();
if ($_SESSION['loggedin'] == '1') {
$rlReturnUrl = $_REQUEST['rlReturnUrl'];
setcookie ("username");
setcookie ("usernameScreenName");
session_unset();
session_destroy();
header ("Location: $rlReturnUrl");
} else {
echo "No User Currently Logged In";
}
?>
setcookie ("username", "", time() - 3600*365);
setcookie ("usernameScreenName", "", time() - 3600*365);
If this doesn't help, then I can only think about two solutions:
1. You set cookie from a root folder, but delete from a subfolder - it won't work
2. Try to destroy cookie with javascript.
Hope this information will help you
Regards
Michal
You are only defining one variable for the cookie, the name, ie -
setcookie("userName");
setcookie likes to have at least 3 defined variables, the name, the value of the cookie (whats contained in it) and the amount of time until it should expire. ie -
setcookie("name", "value", "life_of_cookie");
When you miss the "life_of_cookie" out, they begin to behave very unpredictably. In ie it will not write to the users cookie directory. They get stored in memory, and can't be destroyed by the php function.
If you give your original setcookie all values it expects, then you shouldn't have a problem.