Quantcast
Channel: Cookie set with setcookie, but not found with $_COOKIE - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by Jitendra Pathak for Cookie set with setcookie, but not found with $_COOKIE

$
0
0

I've always had an interesting time when working with cookies. But here are my thoughts :

1) Are you sure $name is passing a value? To check this, echo out $name after you place your cookie. I usually test my vars with echo("name : $name
"); just to make sure that my head and PHP are on the same page. If you recieve a null value, there is your problem.

2) I usually find it benefitial to do a page refresh before reading in any cookies. Though you should put a qualifier like if (!isset($_COOKIE['fasciaoffer'])) { set cookie code }

I hope that helps.


Viewing all articles
Browse latest Browse all 3

Trending Articles