Forum Discussion
Persistence IRule Logic
for the below Irule , i tried to understand its logic , but after i understood i feel it has something wrong :
7 Replies
- SSHSSH_97332
Nimbostratus
Irule Cookie_IP_Persist { when HTTP_RESPONSE { set SessionId [HTTP::cookie ASP.NET_SessionId]:[IP::client_addr] if { [HTTP::cookie ASP.NET_SessionId] != "" }{ persist add uie $SessionId 1800 } } when HTTP_REQUEST { set SessionId [HTTP::cookie ASP.NET_SessionId]:[IP::client_addr] if { [HTTP::cookie ASP.NET_SessionId] != "" }{ persist uie $SessionId 1800 } } }
if { [HTTP::cookie ASP.NET_SessionId] != "" }{ persist add uie $SessionId 1800 }
>>> this checks if Cookie named "ASP.NET_SessionId" has value not empty , it adds persistence record using IP & Cookie
if { [HTTP::cookie ASP.NET_SessionId] != "" }{ persist uie $SessionId 1800 }
>>> thsi checks if if Cookie named "ASP.NET_SessionId" has value not empty , it persists based on SessionId value , but i think here we shouldnot put 1800 ( time out ) , am i right ? - What_Lies_Bene1
Cirrostratus
I'm not sure why you'd want to configure persistence for both the REQUEST and RESPONSE events? - SSHSSH_97332
Nimbostratus
You got my point , i found it like that on many posts & want to understand it , below are examples :
https://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/52/aft/2161049/showtab/groupforums/Default.aspx2237284
https://devcentral.f5.com/Community/GroupDetails/tabid/1082223/aft/8098/asg/50/Default.aspx
https://devcentral.f5.com/wiki/irules.ASP_SessionID_Persistence.ashx - SSHSSH_97332
Nimbostratus
So why it is persisting on request & response at the above Posts ? - What_Lies_Bene1
Cirrostratus
I'm not sure but that's certainly what's suggested in all the posts. I think it has something to do with minimising persistence records but can't be sure. Anyone else? - hoolio
Cirrostratus
With 'persist add' in HTTP_RESPONSE, you're saying you want to manually add a persistence record after the load balancing has already been done with the given token for X seconds. On the request, you're saying you want to look up an existing persistence record using the same token as the key. If a persistence record already exists, its timeout will be updated. If there isn't one, a new record will be added.
When using L7 persistence, to ensure a new persistence record is followed when a request is re-load balanced in a client-side Keep-Alive connection, apply a OneConnect profile to the virtual server.
Aaron - SSHSSH_97332
Nimbostratus
Thanks Steve & Aaron .
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com