PHP not reading cookies?
Moderator: General Moderators
PHP not reading cookies?
I have a script called auth.php that sets a cookie. I know for sure it is being set because I can see it in the list of cookies in FireFox. I have PHP print_r($_COOKIE) on a separate page to test it, but it does not have my cookie...any idea why?
Re: PHP not reading cookies?
setcookie() only takes effect after the page has been reloaded.
Re: PHP not reading cookies?
What do you mean by reloaded?
login form -> auth.php
auth.php sets cookie
auth.php redirects to index.php
login form -> auth.php
auth.php sets cookie
auth.php redirects to index.php
Re: PHP not reading cookies?
Okay, the problem was I needed to add a path to the cookie.