Cookie and subfolder
hello
I create a cookie with:
Code:
SetCookie("accesJeux[nombre]",$valeurCookie,(time() + $dureeCookie*60*60),"/");
with some Php code installed into the root folder, specifying the "/" to make it reachable from anywhere in the website.
I want to add up 1 to its count with:
Code:
$score = $_COOKIE['accesJeux']['nombre'] + 1;
SetCookie("accesJeux[nombre]", $score);
with some other Php code installed into a subfolder.
My problem is that the cookie count is not incremented.
On the other side, when I put that last code into the root folder, le cookie is well incremented.
Thank you in adavnce for your help.
Francois
Francios,
When you set the cookie the second time, shouldn't you also use the "/" designation? It may be setting it for the subfolder, which is why you don't see the increment. Just a thought, but I'd use the same fields as when you created the cookie, every time you reset it.
-Jim
I ran the test you suggested with the incrementing setcookie() setup with the exact same number of parameters as the creating cookie.
It works, the cookie is indeed incremented, this is the solution I was looking for..
Thank you for your help.
Francois
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks