Current time: 11-16-2019, 07:07 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cookies and subdomain
10-31-2011, 03:00 AM
Post: #1
Cookies and subdomain
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.
Find all posts by this user
Quote this message in a reply
10-31-2011, 10:45 PM
Post: #2
RE: Cookies and subdomain
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).
Visit this user's website Find all posts by this user
Quote this message in a reply
11-01-2011, 02:59 AM
Post: #3
RE: Cookies and subdomain
or swith from knowgoa.com to http://www.knowgoa.com?
Visit this user's website Find all posts by this user
Quote this message in a reply
11-02-2011, 03:34 AM
Post: #4
RE: Cookies and subdomain
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.
Find all posts by this user
Quote this message in a reply
11-04-2011, 08:01 AM
Post: #5
RE: Cookies and subdomain
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.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)