Jump to content
Welcome to our new Citrix community!

Persistence session based on Cookie

Recommended Posts

I have to do an configuration on vserver .Persistence should be based on the cookie named “abcxyx”. If the cookie is missing, there should not be any stickiness and it can follow the least connections rule.

Please suggest how can i do it.


on netcscaler we have option to define backup persistence while using cookie insert persistence , what if i leave backup persistence to NONE.


Link to comment
Share on other sites

If your NS is doing the load balancing, when you enable cookie based persistence it will use a system generated cookie name by default OR you can specify the cookie name to use.

When a request comes in the cookie is set and future load balancing will use the cookie.

If the cookie is not present (on first request), then load balancing will determine your destination. But then the cookie will be set.


If you are asking instead for NS to look at a cookie named "abcxyx" set by the application (as siddharthas mentions), and you want to the NS to use this cookie to direct traffic to a specific backend service instead of tracking load balancing itself, then you will probably be using either RULE based persistence  and telling the NS how to extract the value from the cookie or CustomServerID with a rule to extract teh cookie (as siddharthas notes above).  Or you might need to use customserverid persistence, a rule to extract value from cookie, and  then each destination service is assigned a server id and load balancing will direct the traffic to the backend service with the same id as in the cookie set by the application. If no cookie, is set, the traffic will be load balanced.  It depends on what is included in the cookie would determine which method would be better.



Custom Server ID:

lb method: leastconnections

persistence: customserverid and then use a rule to extract cookie:  http.req.cookie("abcxyx")

Then each service (or member of the service group) will need to have the custom server id assigned


Which scenario are you trying to do?  Persistence managed by the NS or the NS evaluating a cookie set by the backend application.


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...