Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Unsetting Cookie for static HTTP request

Unsetting Cookie

8:22 am on Nov 15, 2011 (gmt 0)

New User

joined:Nov 15, 2011
posts: 1
votes: 0

I am working on have a web application where, the HTTP request for static content (images / JS / CSS etc) is going with cookies. Ideally the cookies doesn't hold any significance for the static request except overloading the request. So, I tried giving the below configuration in the Apache's HTTPD.Conf file:

Uncommenting (It was commented prior to my change),
LoadModule setenvif_module modules/mod_setenvif.so &
LoadModule headers_module modules/mod_headers.so

Added below 2 lines,

SetEnvIf Mime image/.* unset-cookie
Header unset Set-Cookie

Post this change, if I intercept the HTTP request using tamper data, I still see the png / jpeg request carrying the cookies with it.

Can somebody help me if I am missing anything else?
8:52 pm on Nov 15, 2011 (gmt 0)

Full Member

5+ Year Member

joined:Apr 26, 2009
posts: 248
votes: 2

what you might need to start from is checking what sets your cookies on the server in the first place, for instance if you are using Google Analytics then you have cookies set on your domain or similar things. Other important thing is to check at wich level of your domain cookies are set, such as www.yourdomain.com or just yourdomain.com.

if the cookies are set to be sent from the global domain (yourdomain.com without www.) then you need to figure out the way to send cookies from the www.yourdomain.com first, then you can transfer all your static content such as images, js, css files to CDN such as amazon s3 or similar and serve your static content from a subdomain that does not send cookies or orhet option is to setup brand new domain to serve only your static content.

I was having this problem up until about 3 weeks ago and managed to sort it out that way. I have also posted another thread in [webmasterworld.com...] where I have aksed the question about correct header settings for different content servd from the same folder, that is basically continuation of my work on speeding up my server through header request/responce and cache contol

Hop this helps

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members