Technical Forum
Ask questions. Discover Answers.
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

Which takes precedence? iRule or Cookie-based Persistence?


Hi DevCentral, I am wondering what would take precedence in this type of scenario.

A VS with a cookie persistence applied with an iRule to redirect traffic based on the URL on the request.

If a fresh connection is established, will it use the cookie first before applying the iRule?

If an already established connection has a cookie already, will it redirect the traffic based on the cookie or will it look at the URL of the request before processing?



We never though on this. I beleive redirection will be first then cookie


Hi @teemo_13 

I think in this case that f5 IRule will take precedence first as the incoming traffic hits first in the IRules configured on the box.

Is this true for both fresh connection and a persistent connection?

For example a client is connected with a persistent connection and the same client had a  request with the URL identifier set on the iRule. Will the iRule still take precedence?

Hi @teemo_13 

yes, this true for both fresh connection and a persistent connection

Hi @teemo_13 , 
Let we explain , we have an iRule used to block specific resource on website , let we say "" , we will configure an iRule to block any one write "" url in his browser and permit anything else to this website. 
Thats good till now , I will assume that I have configured a Cookie Persistence profile so each user will be served by the first server " Pool_mem " replied first time. 

so that , If someone wants to access any resource on "" website other than "" should work without issues , but if someone tries to access this resource "" , it should be blocked by irule Even if this a valid user and is already served by specific Pool_member due to Cookie persistence. 

> in my Example , I want to describe that this user should be blocked by iRule whatever its a new connection or an existing persistence connection. 

> hence , we can deduce that iRule should look at the request first of all and take the precedence. 
I want to say also that iRule is the first Component the Virtual server use againt requests in case there is an iRule attached already through this Virtual server. 

Mohamed Kansoh