Skip to content

Cookie Domain

May 14, 2009

From the site: quirksmode.org

Each cookie also has a domain and a path. The domain tells the browser to which domain the cookie should be sent. If you don’t specify it, it becomes the domain of the page that sets the cookie, in the case of this page http://www.quirksmode.org. Please note that the purpose of the domain is to allow cookies to cross sub-domains. My cookie will not be read by search.quirksmode.org because its domain is http://www.quirksmode.org . When I set the domain to quirksmode.org, the search sub-domain may also read the cookie. I cannot set the cookie domain to a domain I’m not in, I cannot make the domain http://www.microsoft.com . Only quirksmode.org is allowed, in this case.

If I set cookie for site : http://www.abc.com it cannot work -> for my.abc.com
So CAS server can only work for both domains if you specify the p:cookieDomain=”abc.com” in the file
tgtCookieGenerator.xml

By default if domain=/ browser only sends to the url from which cookie is created. Ultimately task of sending back cookie is the responsibility of the browser based on the domain of the cookie.
If cookie is defined with lifetime as -1 (cookieMaxAge) it expires when browser closes.

Advertisements
No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: