Sam10
Jun 24, 2020Altostratus
http cookie persistence
I have an application . When users makes a connection for the first time , server hands over a cookie to the user , when the user comes with the same cookie traffic should go to the same backend node which handed over the cookie.
If the cookie value is session1 , request need to go to node1, If cookie value is session2 request need to go to node2. This is the logic i am trying to work on , it would great help if i can get an irule for this .
when HTTP_REQUEST {
if { [HTTP::cookie exists "SESSION1"] } {
node 1
} else {
if { [HTTP::cookie exists "SESSION2"] } {
node 2
}
else pool default pool
}
}