Solved

.Net Help needed to remove Cookie and header information from Static files (js/css/images)

Posted on 2013-11-12
3
232 Views
Last Modified: 2014-03-03
I have a web application which passes cookie and other information in header. This information is also added to static files which i need to remove.

As part of Yslow recommendations additional header information including cookies should be removed from static files.

I know this is possible to achieve by creating a cookieless sub domain and rendering the static files from there. But this is not feasible solution for my application and client.

Please advise
0
Comment
Question by:samlitu
  • 2
3 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39643779
Then you can't 'remove' cookies.  Cookies that are set on your domain are Always passed back in every request to that domain.  That is part of how browsers make requests for not just pages but images, css files, and javascript files, everything that comes from that domain.  That is why the recommendation is to use a 'cookie-less' subdomain.

But if you can't do it, don't worry about it.  It's not going to be a huge slow down for your pages.  Some of Yahoo's and Google's 'recommendations' can only be used by sites that control their own servers and have lot of resources.  A lot of the recommendations can't be followed on shared hosting because you don't have control of the server.
0
 

Author Comment

by:samlitu
ID: 39643802
Thanks Dave. Will writing httpmodule and handling cookies would help? I am not sure if this would add to page load time as i need to parse the file type and remove cookie and header information.

Any other thoughts..?
0
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 500 total points
ID: 39643836
You can't remove any cookies that have been set in the browser.  It's simply not your choice.  Once the cookies have been set like for ASP Sessions and applications, the browser will continue to send them with HTTP requests until they expire.  See here about cookies: http://en.wikipedia.org/wiki/HTTP_cookie#Setting_a_cookie

And the interaction between client browsers and the web server is done by the browser sending a Request header and the server replying with a Response header and the content.  If you were actually able to remove all header information, your web site would stop working.  This page describe the headers that a browser may send with a request: http://en.wikipedia.org/wiki/List_of_HTTP_header_fields  Note that NONE of those are under your control.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now