0
votes

i have a php script that uses setcookie to set a cookie called "sess". i am using secure=true method with "" as the domain.

in both FF and safari, i can see the cookie is set for the same domain as the __ut (google analytics) cookies

but when i load a page and print_r($_COOKIE) i get only the __ut cookies, and not the "sess" cookie

why isn't php seeing the cookie? is the browser even sending it?

2
Please paste some code into your question so we can see what you are doing... - AJ.
(Sideline) Option secure=true works only if you use secure connection, otherwise, setcookie() is not sending any data to the client. - Wh1T3h4Ck5

2 Answers

2
votes

Since you're using secure mode, make sure you're also using a valid https connection. Also, you should probably specify the domain instead of a blank string.

Does that help?

0
votes

Make sure you aren't checking $_COOKIE from the same request in which you are trying to set the cookie. Cookies aren't available until after the request in which they are set is complete.