Forum Discussion

bmoorewiz's avatar
bmoorewiz
Icon for Nimbostratus rankNimbostratus
Nov 23, 2015

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?

 

1 Reply

  • 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 [ ]