setcookie not working...
Posted: Tue Aug 10, 2004 12:17 pm
I had some weird trouble with the setcookie function, still do actually...
i have some scripts, on the main script it always checks for a cookie to see if someone's logged in and checks that cookie info with the database, if it disagrees with database info, then i just do setcookie($cookie); and it works, it unsets the cookie.
but for some reason it wont here...
it passes the test, but doesn't unset the cookie. it's just headers back to place.php still having the cookie set...
any ideas of what could be going on here? the exact same line works on the other script, but not this one.

i have some scripts, on the main script it always checks for a cookie to see if someone's logged in and checks that cookie info with the database, if it disagrees with database info, then i just do setcookie($cookie); and it works, it unsets the cookie.
but for some reason it wont here...
Code: Select all
if ($_COOKIE[$cookie]) {
setcookie($cookie);
header("Location: place.php");
} else {
// no cookie's set, show login forms...
}any ideas of what could be going on here? the exact same line works on the other script, but not this one.