Forum Discussion

Neeharika_Redd1's avatar
Neeharika_Redd1
Icon for Nimbostratus rankNimbostratus
Jan 29, 2015

Not able to read cookies using F5 iRule

Hi team,

 

We have a requirement to read the cookie set by backend java application and allow access to other pools based on the cookie value. We are using the below iRule, but we are not able to read any cookies set by application (present on the browser - Eg: JSESSIONID).

 

Could you please let us know what is missing in this iRule in reading the cookies OR is any limit of not able to read cookies on F5:BigIP (11.3 version)?

 

Eg: We use below iRule, and always see No cookie present log message though we have that cookie on the browser.

 

when RULE_INIT { set static::Debug 2 } when HTTP_REQUEST {

 

if { [HTTP::cookie exists "JSESSIONID"] } { log local0. "The test cookie value is : [HTTP::cookie value JSESSIONID]" HTTP::redirect "https://www.google.co.in" } else { log local0. "No cookie present" HTTP::redirect "https://facebook.com" } }

 

Thanks, NR