JSESSIONID Persistence

underglundergl Member
Hi all. We have experiencing issues with the VIP with cookie persistence.
Actual config:

port 80 http
no def-selection-if-pref-failed
template http aaurl_switch
template persist cookie Template_PERSIST_Cookie

slb template persist cookie Template_PERSIST_Cookie
expire 0
match-type service-group

The JBOSS admins comment that sometimes there are requests to several nodes with the same JSSESSIONID

What is the configuration to do persistence based on the jsessionid?

Thanks

Comments

  • underglundergl Member
    edited May 2018
    AFLEX to do it:

    when HTTP_REQUEST {

    # Check if there is a jsessionid cookie
    if { [HTTP::cookie exists "JSESSIONID"] } {
    # Persist off of the cookie value
    set jsess_id [HTTP::cookie "JSESSIONID"]
    log "Jession ID is $jsess_id"
    persist uie [HTTP::cookie "JSESSIONID"]

    } else {
    # Parse the jsessionid from the path (URI minus the query string)
    set jsess [findstr [HTTP::path] "JSESSIONID=" 31]

    # Use the jsessionid from the path for persisting
    if { $jsess != "" } {

    persist uie $jsess

    }
    }
    }
    when HTTP_RESPONSE {

    # Check if there is a jsessionid cookie in the response
    if { [HTTP::cookie exists "JSESSIONID"] } {

    # Persist off of the cookie value
    persist add uie [HTTP::cookie "JSESSIONID"]

    }
    }
  • underglundergl Member
    edited May 2018
    Working in PRO - JSESSION ID Cooki persistence:

    when HTTP_REQUEST {
    if { [HTTP::cookie exists "JSESSIONID"] } {
    set jsess_id [HTTP::cookie "JSESSIONID"]
    persist uie [HTTP::cookie "JSESSIONID"]
    } else {
    set jsess [findstr [HTTP::path] "JSESSIONID=" 31]
    if { $jsess != "" } {
    persist uie $jsess
    }
    }
    }
    when HTTP_RESPONSE {
    if { [HTTP::cookie exists "JSESSIONID"] } {
    persist add uie [HTTP::cookie "JSESSIONID"]
    }
    }
Sign In or Register to comment.