Forum Discussion

Kannan_Thalaia1's avatar
Nov 13, 2015

Irule for pool selection base on cookie presence

Hello,

 

I wish to do pool selection base on cookie presence.

 

The logic is simple, if any http request come with a specific cookie ( like JSESSIONID) it need to go to a pool, otherwise it need to go to another pool.

 

Any help be appreciated.

 

Regards, Kannan.

 

2 Replies

  • If you are looking to choose a pool juts on the presence of a cookie this should do the trick. It will require an HTTP profile. If your app is HTTPS it will also require a client SSL profile:

    when HTTP_REQUEST {
        if {[HTTP::cookie exists "JSESSIONID"]}{
            pool poolA
        }
        else {
            pool poolB
        }
    }