Sticky session based on JSessionID

Hello everyone,

Does anyone know if it is possible to create sticky sessions based on the JSessionID?
Our customer requires load balancing for Oracle Application Server based on JSessionID.

Is something like this possible using aflex?

Many thanks in advance!

Regards,
Mat

Comments

  • diederikdiederik Member
    edited November 2015
    Yes it is, have a look here:
    when HTTP_RESPONSE {
       if { [HTTP::cookie exists "JSESSIONID"] } {
          set jsess_cookie [HTTP::cookie "JSESSIONID"]
          persist add uie $jsess_cookie
       }
    }
    
    when HTTP_REQUEST {
       if { [HTTP::cookie exists "JSESSIONID"] } {
          set jsess_id [HTTP::cookie "JSESSIONID"] 
       } else  { 
          set jsess_id [findstr [HTTP::uri] "JSESSIONID=" 11 39 ] 
          if { jsess_id ne "" } {
             HTTP::cookie insert name “JSESSIONID” value $jsess_id
          }
       }
       if { jsess_id ne "" } {
          persist uie $jsess_id
       } else {
          Pool serve-pool
       }
    }
    
  • matmat Member
    edited November 2015
    Hi diederik,

    many thanks for the Info!

    Regards,
    Mat
Sign In or Register to comment.