WebPagetest Forums
Cookies and subdomain - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: Web Performance (/forumdisplay.php?fid=3)
+--- Forum: Optimization Discussions (/forumdisplay.php?fid=5)
+--- Thread: Cookies and subdomain (/showthread.php?tid=6350)

Cookies and subdomain - togoa - 10-31-2011 03:00 AM

Thank you for this great service!
I'm optimizing my site now following instructions of test. One of recommendations is to not send cookies when static content is requested.
OK, i've created subdomain for my images and other resources. Main domain is knowgoa.com and for resources is static.knowgoa.com.
But it seems that browser always send cookies obtained from main domain, to its' subdomains. Is it possible to deny doing it?
I'm using ASP.NET 4.0.

RE: Cookies and subdomain - pmeenan - 10-31-2011 10:45 PM

No, the only way to prevent it if your site is at the top-level would be to use a completely different domain (like staticknowgoa.com).

RE: Cookies and subdomain - allogarage - 11-01-2011 02:59 AM

or swith from knowgoa.com to http://www.knowgoa.com?

RE: Cookies and subdomain - jarrod1937 - 11-02-2011 03:34 AM

Technically www is still a subdomain of the main domain. You either need to use an entirely different domain or specially tell whatever is creating the cookies to limit the cookie domain to only your base domain. For example, example.com sets the cookie only for the base domain, whereas .example.com sets it for all subdomains as well as the base. It is really the browser that is sending the cookies to the server, and only because the cookie has been set ambiguously.

RE: Cookies and subdomain - Markus - 11-04-2011 08:01 AM

For the cookie-free domain it makes sense to use a very short name. Google uses e.g. gstatic.com, 6 digits plus .com.
We use 4 digits plus .de as the website has a .de domain.
We also don't use a www. in the URL of the static domain to save some letters. 10 http-requests without www. means that we save 40 letters. Not a lot, but why not saving when it's so easy?

In your case something like http://kg12.com/files could be ideal.