homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Unsetting Cookie for static HTTP request
Unsetting Cookie

Msg#: 4387082 posted 8:22 am on Nov 15, 2011 (gmt 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?



5+ Year Member

Msg#: 4387082 posted 8:52 pm on Nov 15, 2011 (gmt 0)

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

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved