Forum Discussion

Triggerman_1128's avatar
Triggerman_1128
Icon for Nimbostratus rankNimbostratus
Mar 29, 2010

Persistence based on Querystring

Howdy, we would like to persist based on a querystring. However, there would be two sources (clients) with the same querystring.

 

 

For example:

 

 

1. client one sends a request with a unique Querystring with name SessionID.

 

2. subsequent requests need to persist to the same responding web server.

 

3. client two sends the same querystring (SessionID) to finalise the transaction; therefore it needs to be sent to the same web server responded to above requests.

 

 

Is this technically feasible?

 

 

If not, the other option is to add the Querystring in the HTTP HEADERS but when it comes to step 3 (client two), it will send the SessionID as a querystring and we can't change this as this is a third party app.

 

 

Any assistance is appreciated.

 

2 Replies

  • Hi,

    You can parse the query string parameter value and use it to persist off of. Will clients always send the parameter in each request? If so, here's an example to get started with:

     
     when HTTP_REQUEST { 
      
         Check if query string parameter named SessionID has a value 
         http://devcentral.f5.com/wiki/default.aspx/iRules/uri__query 
        set sid [URI::query "?&[HTTP::query] &SessionID] 
      
        if {$sid ne ""}{ 
      
            Persist off of the session ID value 
           persist uie $sid 
        } 
     } 
     

    Aaron
  • Hi Aaron,

     

     

    Thanks for the reply. Unfortunately, the querystring is not always in the URI.