Hi,
I am a beginner in php. I am setting the cookies on one page and validating them on the next one. I can see the cookies being set in Firefox's cookie editor but the code fails to read the cookies. Here is whats happening:
I authenticate and set the cookie on
http://localhost/page/public/index.php
After authentication, i am redirecting the user to one folder up i.e.
http://localhost/page/home.php
home.php is where i am trying to read the cookie value but it shows up blank.
The code reads the cookies fine if I move home.php to /page/public/ from its current location (/page/).
Can someone please suggest a remedy for this?
Thanks in Advance,
Ankit
Code Failing To Read Cookie
Moderator: General Moderators
-
ankit.kapoor83
- Forum Newbie
- Posts: 2
- Joined: Thu Jun 03, 2010 5:00 am
- markusn00b
- Forum Contributor
- Posts: 298
- Joined: Sat Oct 20, 2007 2:16 pm
- Location: York, England
Re: Code Failing To Read Cookie
Without seeing the code, one can only guess. However, check out the $path parameter for setcookie()
Mark.
Mark.
-
ankit.kapoor83
- Forum Newbie
- Posts: 2
- Joined: Thu Jun 03, 2010 5:00 am
Re: Code Failing To Read Cookie
Thanks.
I had set the path to "/" couple of hours back but it wasnt working. It started working now.
Thanks Anyways
Ankit
I had set the path to "/" couple of hours back but it wasnt working. It started working now.
Thanks Anyways
Ankit