JSESSIONID Persistence

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

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

     \}  
  \}

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