Search
Lori MacVittie - Two Different Socks
You are here: DevCentral > Weblogs

posted on Wednesday, July 08, 2009 3:43 AM

Using network-side scripting to remove client-side cookies

@quine overhead an interesting question that he offered via Twitter regarding cookies and BIG-IP. Specifically someone was wondering whether BIG-IP automatically removes cookies from the browser. removecookies

Our team had a quick discussion because the question isn’t as straight-forward as it first appears. On the surface the answer is an unequivocal “no”, because for an intermediary to just arbitrarily remove cookies would be a Very Bad Thing. But the ability to manipulate cookies is certainly something you can do using iRules, and if you implemented such functionality then the answer very well could be “yes”.

There are any number of reasons you might want to remove cookies via an intermediary like BIG-IP. It could be that the developer of the cookie-monster3 application inadvertently left out that functionality. It could be that the application is a third party purchased application and the removal of cookies isn’t included but you really want to offer that functionality. It could be that you want to give users/visitors the ability to arbitrarily delete a cookie your application has set, just because you’re nice that way. Whatever the reason, removal of cookies – really any cookie manipulation -- is simplicity itself using iRules:

when HTTP_RESPONSE {
   HTTP::cookie remove <cookiename>
}

Really, that’s it. You’ll probably want more logic around it than that, but the core of the solution is just one simple command. Now I’d love to be able to say that this functionality is unique to iRules and F5, but it’s not. Pretty much any intermediary with network-side scripting capabilities should be able to perform this function as well. For example, Apache’s mod_header can manipulate HTTP headers, including cookies. It looks like you could use the command unset to remove a cookie using a mod_header configuration.

So the more precise answer to @quine’s question is: “Yes, but only if you tell it to.”

Follow me on Twitter View Lori's profile on SlideShare friendfeedicon_facebook AddThis Feed Button Bookmark and Share

Related blogs & articles:



Feedback

8/16/2010 10:26 AM
Gravatar My concern, is since we from time to time have to fail one LTM to the other on the cluster and back to unlock a virtual server, is does the stack for cookies on each pool member have a limit, and does it dump cookies after that limit?

larry
Larry Dalton
8/24/2010 1:04 PM
Gravatar Hi Larry,

Cookies are stored on the client, so there's really no limit on the LTM regarding them and in fact it is just this scenario that is well-served by cookies on the client as they can maintain vital connection information during a fail-over.

If you were thinking more of the persistence table (which often takes advantages of cookies) then there is a theoretical limit on that table but it should not be impacted unless the LTM itself is rebooted or in the case of an LTM --> LTM failover if there is a problem with session mirroring.

Hope that helps!
Lori
macvittie

Let Me Know What You Think


Please use the form below if you have any comments, questions, or suggestions.

Title:
 
Name:
 
Email: (so we can show your gravatar)
Website:
Comment: Allowed tags: blockquote, a, strong, em, p, u, strike, super, sub, code
 
Please add 2 and 2 and type the answer here:

Blog Stats

Posts:975
Comments:1681
Stories:0
Trackbacks:582
  

Image Galleries

  

Application Delivery

  

Cloud Computing

  

Random

  

Security

  

Chat Catcher

82,243 Members in 102 Countries and Growing!

Join DevCentral Today!

About DevCentral

DevCentral has been a successful, thriving community for many years. We have always strived to bring you the best technical documentation, discussion forums, blogs, media and much more that we can.

So dive in, get familiar with DevCentral. We hope you like it, we hope it makes your job easier, and lets you get that much more power out of the community. To learn more, make sure to check out the Getting Started section. And if you have any problems, or think something could be easier to use, drop us a line to let us know.

Got It !

We've received your comment and transmitted it directly to DevCentral HQ.

Thanks for taking time to let us know what's on your mind. At DevCentral | Community Matters!

Get In Touch With Us

Have questions, suggestions or just want to get something off your chest?

Use our handy form below to Direct Connect with DevCentral Mission Control.

Send Us Feedback       or