Add SameSite attribute to APM Cookies
Problem this snippet solves:
This irule add SameSite attribute with value None to APM Cookies. related to Chrome 80 behavior change : Cookies default to SameSite=Lax
When you put "SameSite=None", you must have the "Secure" attribute set to the cookie.
How to use this snippet:
Add the irule to a Virtual Server.
Change value of the attribute from None to desired value.
Pay attention to possible interferences with other irules applied to Virtual Servers.
Code :
when RULE_INIT { set static::apm_cookies { "F5_fullWT" "F5_HT_shrinked" "F5_ST" "LastMRH_Session" "MRHSequence" "MRHSession" "MRHSHint" "TIN" "F5_VdiUserClientChoicecitrix" "F5_VdiUserClientChoicevmware_view" } } when CLIENT_ACCEPTED { ACCESS::restrict_irule_events disable } when HTTP_RESPONSE_RELEASE { foreach apm_cookie ${static::apm_cookies} { if { [HTTP::cookie exists ${apm_cookie}] } { HTTP::cookie attribute ${apm_cookie} insert "SameSite" None if { ![HTTP::cookie attribute ${apm_cookie} exists "secure"] } { HTTP::cookie attribute ${apm_cookie} insert "Secure" } } } }
Tested this on version:
12.1Published Jan 30, 2020
Version 1.0