Forum Discussion

Karan_Dadwal_23's avatar
Karan_Dadwal_23
Icon for Nimbostratus rankNimbostratus
Nov 19, 2015

iRULE to secure F5 cookie

Hi

 

I added irule below to add secure flag on cookie sent by F5 to client but post implementation JSESSIONID cookie disappeared:

 

when HTTP_RESPONSE { foreach mycookie [HTTP::cookie names] { HTTP::cookie secure $mycookie enable } }

 

Any prompt response would be appreciated.Thanks

 

1 Reply

  • Hi Will this solve : Rule set 1: when HTTP_RESPONSE { foreach x [HTTP::cookie names] { if { $x starts_with "cookiename1" or "cookiename2" } { HTTP::cookie secure $x enable } } } ==================================================================================== Rule set 2: when HTTP_RESPONSE { foreach x [HTTP::cookie names] { if { $x contains "cookiename1" or "cookiename2" } { HTTP::cookie secure $x enable } } } I am using cookie persistence and adding cookie name.cookiename1 is used on set of one VIPs and cookiename2 is used on another. I want irule to be able to set secure flag to these cookies only and not any other returned by server or app. Will this irule meet my purpose without altering any other cookie in HTTP response. Thanks