Forum Discussion
iRule syntax issue
I have tried to validate the iRule below, but it errors with:
[braces are required around the expression][when HTTP_RESPONSE {
Cookie Management Verification
when HTTP_RESPONSE {
if {[HTTP::cookie count] > 0} {
set maxCookieSize [class match -value "CookieMaxSize" equals COOKIE_INFO_LIST]
foreach cookie_name [HTTP::cookie names] {
if {![class match $cookie_name equals MASTER_COOKIE_JAR_LIST]}{
log local0.info "INVALID SET-COOKIE DETECTED – Cookie:$cookie_name"
}
set cookieSize [string length [HTTP::cookie $cookie_name]]
if [ $cookieSize > $maxCookieSize ] {
log local0.info "INVALID SET-COOKIE SIZE – $cookieSize for Cookie:$cookie_name"
}
}
}
}
- Michael_Yates
Nimbostratus
I had to retype it from scratch to get it to behave and only alert on the DataGroup Names.when HTTP_RESPONSE { if { [HTTP::cookie count] > 0 } { set maxCookieSize [class match -value "CookieMaxSize" equals COOKIE_INFO_LIST] foreach cookie_name [HTTP::cookie names] { if { ![class match $cookie_name equals MASTER_COOKIE_JAR_LIST] } { log local0. "INVALID SET-COOKIE DETECTED - Cookie: $cookie_name" } set cookieSize [string length [HTTP::cookie $cookie_name]] if { $cookieSize > $maxCookieSize } { log local0. "INVALID SET-COOKIE Size - $cookieSize for Cookie:$cookie_name" } } } }
- Thank you Michael. Not sure what was tripping it up, but it looks good now.
- I see what was wrong now, incorrect brackets here:
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com