sticky cookie with variable cookie name

Answered Question
May 11th, 2010

Hello all,

is possible to configure ACE4710 for sticky on the base of cookie name ASPSESSIONID[A-Z]. |For example ASPSESSIONIDA=server1. See following:

sticky http-cookie ASPSESSIONID[A-Z] asp
  serverfarm TEST2

policy-map type loadbalance first-match LB_1
  class URL
    serverfarm TEST1
  class URL_CZ
    sticky-serverfarm asp

- it doesn't work, because I cann't to use regular expressions in the cookie name:-(

So I tried to configure following:

sticky http-header Cookie pokus
  header offset 13 length 8
  serverfarm TEST2

policy-map type loadbalance first-match LB_1
  class URL
    serverfarm TEST1
  class URL_CZ
    sticky-serverfarm pokus

- it is better, but I am sticky on the base of the second request.:-(

So is there some solution for a variable cookie name? Thank you. Roman

I have this problem too.
0 votes
Correct Answer by Gilles Dufour about 6 years 6 months ago

No, the cookie name needs to be static....the dynamic part is the value and that's the one we can learn.

Gilles.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
UHansen1976 Tue, 05/11/2010 - 11:46

Hi Roman,

Have you tried configuring cookie insertion with static values?. Would look something like this:

sticky http-cookie ASPSESSIONID asp

  timeout [min]

  replicate sticky

  cookie-insert browser expire

  static cookie-value SERVER1 rserver [name of rserver]

  static cookie-value SERVER2 rserver [name of rserver]

  serverfarm TEST2

Optionally, you can specify a portnumber after the rserver-name and a backup-serverfarm after your primary serverfarm (TEST2 in your case).

Check out http://www.cisco.com/en/US/docs/app_ntwk_services/data_center_app_services/ace_appliances/vA3_1_0/configuration/slb/guide/sticky.html

hth

ROMAN TOMASEK Tue, 05/11/2010 - 11:49

Hello,

I know it, but the customer wants to use a dynamic cookie from an ASP script on the server side. Thanks.

UHansen1976 Tue, 05/11/2010 - 15:30

My apologies, I guess I misunderstood your question.

I've never configured stickyness based on a cookie-value that is not sourced from the ACE itself, so I really couldn't tell you if it would work. But according to the doc, the ACE can be configured to dynamically learn portion of the http-content (e.g. cookie) and provide stickyness based on this.

In my experience though, when parsing the http-header for specific content, there is one thing in particular you need to ensure. By default, the ACE only parses a certain length of the http-header (2048 bytes), so if the http-header exceeds this length, you might fail to locate the cookie value and your stickyness is lost. I've had this happen to me and the solution is to create an http-parameter-map and configure a parse-length of a higher value (e.g. 8k).

Also, I think persistence-rebalance is required, unless you only want to inspect the first requst and simply "switch" all subsequent requests to the same rserver.

hth

Correct Answer
Gilles Dufour Wed, 05/12/2010 - 01:23

No, the cookie name needs to be static....the dynamic part is the value and that's the one we can learn.

Gilles.

Actions

This Discussion