Cookies driving me nuts! I spent the entire weekend reading setCookie() on php.net and searching/browsing this forums.
setting cookies isn't a problem, it didn't retreive anything, so I browse some more, got it to retreive and now it will not set a new cookies. The first cookies set is permanent! Setting a new value for the same cookies will not update it. Is this a browser bug? Anyway here is the code I use:
// Cookies information
$cookie_life = 30243600;
$c_name = "themes"; // cookies name
if ($QUERY_STRING == "themes")
{
// Set cookies and continue
setcookie($c_name,$themes,(time()+$cookie_life),'/','',0);
$$c_name = $themes;
Header("Location: /");
}
$someValue = $HTTP_COOKIE_VARS[$c_name];
if (isset($someValue)) {
echo "got cookies: $someValue";
}
else { // $someValue is neither set
}
after selecting a theme for the first time, selecting another theme will not update the cookies.
cookies.txt
www.mydomain.ca FALSE / FALSE 989893234 themes red