views:

57

answers:

1

I just did an audit of one of my web application page (built using ASP.Net and running on development server) using Google chrome's developer tool. One particular warning caught my eyes:

Serve static content from a cookieless domain (5)!

Here is my screen shot (http://yfrog.com/7eauditresultp) as well. I would like to know is it possible to avoid cookies for these kind of requests. I see that there is no cookie requests for javascript files as well. I it possible to avoid cookies in the header for these files as well? and why didn't the browser attach cookies for javascript files and attach for CSS and image?

Any thoughts and suggestions are welcome

+1  A: 

Cookie are "attached" to a domain and a path. If you set cookies for a path above your files, they'll be sent with any request for those files.

The warning message itself tells you how to fix this - use another domain for your static content. Or a subdomain, as long as you make sure you keep your main domain cookieless in that case.

Matti Virkkunen
yes, I understood that the solution is to move the files to a cookieless domain. What I need to know is why cookies did not get attached to javascript files during the request and only to css and image?
Abdel Olakara
@Abdel: Perhaps the tool missed those requests. Got a link to the page in question so I could see for myself?
Matti Virkkunen
unfortunately no.. let me check again if the tool missed them out
Abdel Olakara