Forum Discussion

Karel_Kohout_51's avatar
Karel_Kohout_51
Icon for Nimbostratus rankNimbostratus
Nov 23, 2006

Persistence for users with and without cookies

Hello,

 

 

we have run into an interesting problem and I wonder if anyone of you alredy solved it. The situation is as follows.

 

 

We have several backend servers loadbalanced by BigIP, the load balancing method is Round Robin. The backend servers are not capable of synchronizing sessions between themselves, therefore the prsistence is a crutial function in this scenario. Users from all over the globe connects to this application. Some of them support cookies some of them not. The backend server response is based on the possibility of client to accept cookies. If the client can accept cookies, it will place a cookie there, also BigIP can place a cookie there and persistence works fine. The problem is with clients without cookie support. In this case the backend server uses the URL string, where it inserts the cookie. And we need to setup persistence for these connections as well, but we cannot use the persistence based on cookies. Is there any possibility to create and iRule, which can control the persistence in this case. Thank you for any advices.

 

 

Best Regards

 

Karel
  • In case of any of the viewers of this forum needs it, here is the iRule that solves my problem. However the application behaves slightly different than originally described, so it does not work for us.

     

     

    rule jsessionid_persist {

     

    when HTTP_REQUEST {

     

    set jsess_id [findstr [HTTP::uri] "JSESSIONID=" 11]

     

    if { ( $jsess_id eq "" ) and ( [HTTP::cookie exists JSESSIONID] ) } {

     

    set jsess_id [HTTP::cookie JSESSIONID]

     

    }

     

    if { $jsess_id ne "" } {

     

    persist uie $jsess_id

     

    }

     

    }

     

    when HTTP_RESPONSE {

     

    set jsess_id [HTTP::cookie JSESSIONID]

     

    if { $jsess_id ne "" } {

     

    persist add uie $jsess_id

     

    }

     

    }

     

    }