Forum Moderators: coopster
to determine whether or not the cookie has been set.
The first time I enter the web page, I receive the not set message and upon exiting I can find the cookie file in the C:\Documents and Settings\username\Cookies directory.
The second time I enter the web page, I receive the cookie found message and the cookie value is used.
When I exit from the web page, the cookie is gone from the C:\Documents and Settings\username\Cookies directory.
The 3rd time I enter the web page, I again receive the cookie not found message.
What causes this cookie to disappear on me. Is it not just supposed to update?
TIA
D
setcookie("hdclimit", $_GET['CLIMIT'], time() + (3600 * 24 * 364) + 5,"/", ".v4.#*$!.com");
the cookie is correctly set on the first pass through. I then exit the browser and am able to find the cookie in the C:\Documents and Settings\username\Cookies directory and it does have the correct value.
The second time I go to the web site, the cookie is retrieved and used, then appears to be deleted as when I exit the browser, the cookie is no longer in C:\Documents and Settings\username\Cookies directory and if I go back into the web site, it is not retrieved
How do I keep the cookie and update it everytime the web site is used without it disappearing on me?
TIA
D
There's no way around it.
As for disappearing cookies see if you're not deleting them yourself.
Eg. this code would work as you described:
member.php?bla=1:
setcookie("bla", $_GET['bla'], time() + (3600 * 24 * 364) + 5, "/", ".v4.#*$!.com");
if(!$_COOKIE['bla']) header("Location: member.php");
In the first sweep you set the cookie to 1, but COOKIE is not set!
In the second sweep you delete the cookie: GET['bla'] is empty, but COOKIE is set!
Hope this may be of any help.
Michal Cibor