![]() ![]() ![]() To summarize, the domain option allows to make a cookie accessible at subdomains. That’s an old notation and should be used if we need to support very old browsers. make the cookie accessible on any subdomain *.:ĭokie = "user=John domain="Īlert(okie) // has cookie user=Johnįor historical reasons, domain=. (with a dot before ) also works the same way, allowing access to the cookie from subdomains. Please note, by default a cookie is also not shared to a subdomain as well, such as. It’s a safety restriction, to allow us to store sensitive data in cookies that should be available only on one site.īy default, a cookie is accessible only at the domain that set it. There’s no way to let a cookie be accessible from another 2nd-level domain, so will never receive a cookie set at. In practice though, there are limitations. domainĪ domain defines where the cookie is accessible. Usually, we should set path to the root: path=/ to make the cookie accessible from all website pages. ![]() If a cookie is set with path=/admin, it’s visible at pages /admin and /admin/something, but not at /home or /adminpage. It makes the cookie accessible for pages under that path. okie = "user=John path=/ expires=Tue, 03:14:07 GMT" path ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |