Forum Discussion

crocketv_18020's avatar
crocketv_18020
Icon for Nimbostratus rankNimbostratus
Jan 05, 2010

JSESSIONID Cooke Persistance

Hello,

 

Please excuse.. i'm sure this is basic stuff but not so basic to me.

 

 

I need some help with adding a cookie type persistance which i'm not familiar with.

 

 

I have a VS which works on HTTPS /w SSL off-load configured on the F5.

 

 

I have come to learn that many of the users from some areas hitting this URL will be sourced from a single IP address.

 

 

Currently the VS uses source address persistance. This will not load balance well between the pool member servers for this VS because of the large user base coming in with single source address.

 

 

Need assistance creating an iRule that will work for me for session cookie (JSESSIONID) persistance. I have an example from a different F5 below but I not sure I completely understand it from top to bottom and if it will work for me in this case.

 

 

Appreciate any help with this and some steps in tying the iRule to persistance profile for the VS. Thanks.

 

 

 

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"]

 

}

 

else {

 

set jsess [findstr [HTTP::uri] "jsessionid" 11 "?"]

 

if { $jsess != "" } {

 

persist uie $jsess }

 

}

 

}

 

  • Have a look here - there's some good general info, with a jsessionid persistence example as well: https://support.f5.com/kb/en-us/solutions/public/7000/300/sol7392.html

     

    -Matt
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    There is a slightly more complete Codeshare entry as well. The comments in that iRule should hopefully give you more detail on what the iRule is doing.

     

     

    http://devcentral.f5.com/wiki/default.aspx/iRules/Weblogic_JSessionID_Persistence.html

     

     

    Aaron