Forum Discussion
anujl_5566
Nov 02, 2011Nimbostratus
Persistence Cookie iRule not working as desired
when HTTP_REQUEST {
if { [HTTP::path] equals "/api/v1/sendpinonceoff" } {
HTTP::path /sendpinonceoff
pool MM-MEPD
persist none
}
if { [HTTP::path] equals "/api/v1/verifypinonceoff" } {
HTTP::path /verifypinonceoff
pool MM-MEPD
persist none
}
if { [HTTP::path] equals "/api/v1/processrefund_status" } {
HTTP::path /processrefund_status
pool MM-MEPD_Deliver
persist none
}
if { [HTTP::path] equals "/api/v1/processrefund" } {
HTTP::path /processrefund/
pool MM-MEPD_Deliver
persist none
}
if { [HTTP::path] equals "/api/v1/sendpinajax" } {
pool MM-MEP
persist cookie insert "MM-MEP-SENDPIN"
}
}
Now when I go to the url /api/v1/sendpinajax, I see the cookie MM-MEP-SENDPIN. The problem is I also see the default persistence cookie set for the Virtual Server. Is this desired behavior?
- O.K. I have not tested it, so you'll have to do it the other way round :-)) Sorry for that.
when HTTP_REQUEST { persist none all the other stuff if { [HTTP::path] equals "/api/v1/sendpinajax" } { log local0. "[IP::client_addr]:[TCP::client_port]: this is the path [HTTP::path] " HTTP::respond 200 content "HTTP path [HTTP::path]\n\n" HTTP::path /sendpinajax pool MM-MEP persist cookie insert "MM-MEP-SENDPIN" } }
- nitassEmployeei understand persistence profile is required when using persist cookie command.
- anujl_5566NimbostratusGuys thanks for all the help. I will use persist none in for the urls where I do not need persistence and default persistence profile for urls where i need persistence. I am doing this because I am sure in future we will have urls wich will select new pool members and the KB article which I pasted above talks about this limitation , that if we have an iRule which selects differnt pools with non similar pool members, persistence fails unless we have default cookie name.
- nitassEmployeeAlso as Kurt mentioned if the same TCP session is used to do a Get requet for a new url persitence will not work as desired because it is based on sessions. I noticed that while testing from my browser, so when I was jumping from one url which had persistence to one which did not have, I was not getting right pool member until i hit rtefreshed once or twice, which I guess in the back opens a new TCP socket and the persistence selection logic kicks in. if i'm not wrong, Kurt may want to mention this sol.
- anujl_5566Nimbostratusnitass.. :) I tried oneconnect on my profile and I like it ..It solves the problem when I am changing urls w/o closing browser which have different persistence behavior according to the iRule
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects