Solved

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

Posted on 2013-11-12
3
236 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 83

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 83

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Change in PHP Behavior with Session Write Short Circuit (http://php.net/manual/en/book.session.php#116217) (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
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…

739 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