For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Insert App Cookies In Http Redirect

Problem this snippet solves:

This rule intercepts the application response and sends an HTTP redirect to the client with any cookies the application set in its response.

Code :

when HTTP_RESPONSE {

   # Check if the response matches our criteria
   if {$some_condition == 1}{

      log local0. "[IP::client_addr]:[TCP::client_port]: Matched the response check."

      if { [HTTP::header exists Set-Cookie] }{
         HTTP::respond 302 Location "http://example.com" Set-Cookie [join [HTTP::header values Set-Cookie] "; "]
      } else {
         HTTP::respond 302 Location "http://example.com"
      }
   }
}
Published Mar 18, 2015
Version 1.0
No CommentsBe the first to comment