Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A cookie without a domain?

Is it possible to set a cookie without a domain?

This will mean all domains will have access to it.

like image 319
jamjam Avatar asked Feb 03 '12 18:02

jamjam


1 Answers

No, that is not possible. If a cookie doesn't declare a domain, the browser will assume the domain of the object requested.

What you're asking for is generally considered a security, or at least privacy, risk. It's possible to configure browsers to allow access to cookies from other than the domain that they were created, but browsers aren't commonly configured that way.

like image 67
Michael Petrotta Avatar answered Oct 20 '22 11:10

Michael Petrotta