Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

jsessionID iRule

Here is the output from code share...

when HTTP_RESPONSE { if { [HTTP::cookie exists "JSESSIONID"] } { persist add uie [HTTP::cookie "JSESSIONID"] } } when HTTP_REQUEST { if { [HTTP::cookie exists "JSESSIONID"] } { persist uie [HTTP::cookie "JSESSIONID"] } }

How do I take this iRule and ignore case? Unfortunately the dev team can't seem to keep case with their cookies, so some are JSessionID, some are JSESSIONID, some are jsessionid and some are jsessionID. Is there a way to ignore case or add an or statement to look for all of them?

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Hi, could you try this way?

when HTTP_REQUEST {
    set jsessionid [lsearch -inline -regexp [HTTP::cookie names] {[J|j][S|s][E|e][S|s][S|s][I|i][O|o][N|n][I|i][D|d]}]
    if { $jsessionid ne "" } {
        persist add uie [HTTP::cookie $jsessionid]
    }
}

Regards [ ]

0