httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: [users@httpd] Setting cookies from proxied backend
Date Fri, 18 Jul 2008 08:14:48 GMT

First, I found a thread which might provide some useful information for 
the original poster :

Second, wrote:
> On 7/17/08, jamanbo jamanbo <> wrote:

Rescpectfully, I believe there are several inaccuracies in the 
explanation given by solprovider, and this might induce the OP in error.
The notes below represent my own understanding of the matter, based on
Please correct me if I am wrong.

> Cookies are set for the parent domain part of the server name.  The
> Cookie for "" is set at"".

The server "" can technically (try to) set a cookie for 
whatever domain it chooses, via a "Set-Cookie" header.  By default (when 
not specified), the cookie domain is understood as being the domain that 
exactly matches the server's FQDN (fully-qualified domain name, like 

Now whether the browser accepts it is another story.

A browser respectful of the specification would only accept a cookie 
from a server, if the server's own domain "belongs to" (is a sub-domain 
of) the cookie domain.
For example, from a server known as "", a browser will 
accept a cookie for the domain "" or "" 
or "" or "" (but not for ".com" because that 
domain does not contain at least two dots).

(The reason for that is that it is considered unsafe that a server 
"" should be able to set a cookie for the server 
"" for instance).

> Cookies cannot be set at the TLD level. 
True in a way, see above, but only because the browser should not accept 
a cookie for a domain that does not contain at least 2 dots.

Default domain no-name servers
> ("") cannot use Cookies because the Cookie would be set at
> the ".com" TLD.
The server "" can set a cookie for "".

Browsers will save the Cookie
> at the next level ("") and send the Cookie with every
> request to *  A server name at the same level must be
> specified.  Requests to "" and
> "" will not include the Cookie.
The browser will save the cookie with the domain exactly as specified in 
the cookie, it this is valid (iow the domain of the cookie contains at 
least 2 dots, and the server issuing the cookie is a member of that domain).

A cookie set for "" will be sent by the browser with any 
request to "", or "", or 
"" or "".
A cookie set for "" will be sent with every request to a 
server "" or "" or "", 
but not for "" not for "" e.g.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message