Cookie persistence + iRule
Hi,
I have VS configured with iRule and persistence profile:
iRule: when HTTP_REQUEST { bla bla bla bla bla bla } else { pool DNN_HTTP persist cookie insert lbhint 0
Persistence profile: Cookie Method: Insert Name: lbhint Always Send Cookie: Yes Expiration: Session Cookie
Now, my site configured to insert cookie named lbhint and the code checks if i dont have lbhint cookie it inserts it, then it checks each request if the cookie value equals to the servers that responded to my request, if it equals it does nothing, if its different it changes it to the server the responded.
Example: Request http://www.mysite.com (server-1 responded) --> code checks lbhint exists (no) --> insert lbhint=server-1 Request 2: (server-1 responded) --> code checks lbhint exist (yes) --> does it equal to server-1 (yes)? --> do nothing Request 3: (server-2 responded) --> code checks lbhint exist (yes) --> does it equals to server-2 (no) --> change value lbhint=server-2
Now, i want my LB to keep the session persistence based on this cookie but it doesn't work, i tired to play with the profile methods, but no luck. When i check http headers i noticed that i see 2 cookies named lbhint, one with server value and the other is random chars and numbers (somthing like 34jbvh5vetv345vhj35). Another thing i noticed that it failed most of the time when my request from http switched to https (its 2 VS, one for http and another for https, and so i have to iRules, one for http pools and one for https pools).
1) As you noticed server name inserted in lbhint is server-1 however my NODE name in F5 is server_1 (with underline) - Can it affect it? 2) Any ideas ti help me?