Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

iRule to delete the cookies

NetWork
Nimbostratus
Nimbostratus

We have a requirement to delete the SSO cookies after logging out the application. Can someone help if this can be achieved through iRule?

1 REPLY 1

Do you mean the APM session or other SSO cookies, try testing this or feel free to customize if you know the cookie name.

ltm rule remove_logout_cookie {
when HTTP_REQUEST {
  set logging_out 0
  set cookie_names [HTTP::cookie names]
  if {[string tolower [HTTP::path]] ends_with "logout.php" } {
    set logging_out 1
  }
}
 
when HTTP_RESPONSE {
  if { $logging_out == 1 }{
    foreach cookie_name $cookie_names {
	  HTTP::cookie remove $cookie_name
    }
  }
}
}