Reorder Http Cookies

Problem this snippet solves:

If for some reason you want to make sure all your cookies are neat and tidy, this iRule will reorder them for you so your backend server doesn't have to take on that burden.

Code :

  if { [HTTP::cookie exists "cookie-name"] } {
    set cookie_s [HTTP::cookie "cookie-name"]
    HTTP::cookie remove "cookie-name"
    set cookie_a [HTTP::header cookie]
    HTTP::header replace "cookie" "$cookie_a; WLSID=$cookie_s"
Published Mar 18, 2015
Version 1.0

Was this article helpful?