SwiftD
SwiftD

Reputation: 6079

Cookies being sent with requests to cookie free subdomain (Only in Firefox)

I havce created a new subdomain called static.mydomain.co.uk in an attempt to serve static content from this cookie free domain, trouble is fireox is including the cookies in all requests.

The subdomain points to the same folder as my main domain and my cookies are using jquery.cookie.js. The cookies look like this:

$.cookie('file_current', '1', {domain: 'www.mydomain.co.uk'});

when I look in the net traffic through firebug all images, css, js etc hosted on the sub domain have cookies included in the response headers, when I look at the same info through IE9, there are no cookies sent with the response headers (as I would like it)

This is happening with the cookies I have set as well as with the session cookie which I have through codeigniter which also has the domain restriced to 'www.mydomain.co.uk'

The site is live at www.alexchapman.co.uk if anyone would like to inspect themselves - the loading times are not great at the moment so I am keen to remove the uneccessary cookie traffic

Any ideas what is happening here?

Upvotes: 1

Views: 461

Answers (1)

SwiftD
SwiftD

Reputation: 6079

OK, I was being a bit of a muppet here. I worked this out by running the php function phpinfo(); on a page on its own - this will list all cookies being run when you access the page (along with a lot of other info - I was actually trying to find solution to a gzip issue). Since it doesnt initiate any cookies itself you should have no cookies listed if you have deleted all the cookies for the domain.

I had been deleting cookies for mydomain.com (which covers www.mydomain.com), but a cookie had at some point been created for static.mydomain.com which I hadn't deleted. Once I deleted this and reloaded the page all was well.

Hope this help someone with a similar issue

Upvotes: 1

Related Questions