Ok I have a cookie set, and I can clearly see it if I go to private data in Firefox... ok so when I echo it on one page in a certain directory it works, (www.example.com/dir), but on the index page of the site (www.example.com), it wont echo, it says the cookie is not set. Yes I have cookies enabled, yes I tried clearing cache and all that. Any ideas? PHP btw
That, or the dough wasn't cool enough before baking. Warm cookie dough or excess butter will cause the cookies to spread too much, baking quickly on the outside but remaining raw in the middle. Next time, chill your cookies in the fridge for 10 minutes before you bake them. If the problem persists, use less butter.
Cookies are stored on your device locally to free up storage space on a website's servers. In turn, websites can personalize while saving money on server maintenance and storage costs.
Cookies are usually set by a web-server using the response Set-Cookie HTTP-header. Then, the browser automatically adds them to (almost) every request to the same domain using the Cookie HTTP-header.
httponly is a flag you can set on cookies meaning they can not be accessed by JavaScript.
Which directory are you in when the cookie gets set?
From the PHP manual on setcookie(), emphasis mine:
Path
The path on the server in which the cookie will be available on. If set to '/', the cookie will be available within the entire domain . If set to '/foo/', the cookie will only be available within the /foo/ directory and all sub-directories such as /foo/bar/ of domain . The default value is the current directory that the cookie is being set in.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With