cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
823
Views
0
Helpful
7
Replies

ACE: Stickyness, Cookie in URL

Sbutzek
Level 1
Level 1

Hello,

I have a problem with cookies in the URL if the browser does not support Cookies in the http header.

I'm setting the cookie in the url static , so the URL looks like:

http://testfarm/sticky.cgi?serverid=1.1.1.1

And configure the sticky group:

sticky http-cookie serverid sticky-farm cookie secondary serverid

replicate sticky

serverfarm sticky-farmm 8 static cookie-value "1.1.1.1" rserver server1

16 static cookie-value "1.1.1.2" rserver server2

What's wrong with my configuration?

If the client accepts cookies in the Cookie header anything works but not if the client rejects the cookie.

7 Replies 7

Gilles Dufour
Cisco Employee
Cisco Employee

Did you define a port for each server inside the serverfarm ?

If yes, you need to specify this port in the static entries.

Gilles.

Hi Gilles,

no, i did not specify a port in the serverfarm or in the realserver.

The configuration looks like this:

sticky http-cookie serverid ST-sticky-farm

cookie secondary serverid

replicate sticky

serverfarm sticky-farm

8 static cookie-value "1.1.1.1" rserver server1

16 static cookie-value "1.1.1.2" rserver server2

policy-map type loadbalance first-match L7-10-1-1-1

class class-default

sticky-serverfarm sticky-farm

policy-map multi-match L4_SLB_POL_external

description L4 Policy fuer SLB ohne NAT

class V-10-1-1-1

loadbalance vip inservice

loadbalance policy L7-10-1-1-1

loadbalance vip icmp-reply active

appl-parameter http advanced-options HTTP-rebalance

class-map match-any V-10-1-1-1

2 match virtual-address 10.1.1.1 tcp eq www

serverfarm host sticky-farm

probe tcp80-i30

rserver server1

inservice

rserver server2

inservice

rserver host server1

ip address 1.1.1.1

inservice

rserver host server2

ip address 1.1.1.2

inservice

Sven

Sven,

I tested your config in my lab and it works for me.

I used version A2(1.4)

What version do you run ?

Gilles.

Gilles,

I've used A2(1.4)a,

how did you test the Configuration?

Sven

Sent the following request 10 times:

GET /index.html?serverid=1.1.1.1&session_id=1234 HTTP/1.1

Host: 10.86.213.27

x-value: 12345

Accept: */*

Accept-Charset: *

Accept-Language: *

Connection: Keep-Alive

Then did a show serverfarm

switch/Admin# sho serverfarm linux4

serverfarm : linux4, type: HOST

total rservers : 2

---------------------------------

----------connections-----------

real weight state current total failures

---+---------------------+------+------------+----------+----------+---------

rserver: linux1-24

192.168.30.24:0 8 OPERATIONAL 0 1 0

rserver: linux4

192.168.30.44:0 8 OPERATIONAL 0 11 0

And all entries appear on server linux4 as configured.

sticky http-cookie serverid CookieLinux4

cookie secondary serverid

8 static cookie-value "1.1.1.1" rserver linux4

16 static cookie-value "1.1.1.2" rserver linux1-24

serverfarm linux4

Gilles

Hi Gilles,

we are both right, i think i know the problem.

I've first configured a sicky group without the support for cookies inside the URL:

1)

sticky http-cookie serverid ST-sticky-farm

replicate sticky

serverfarm sticky-farm

8 static cookie-value "1.1.1.1" rserver server1

16 static cookie-value "1.1.1.2" rserver server2

Then i added the support for url cookies

2)

sticky http-cookie serverid ST-sticky-farm

cookie secondary serverid

This is not working unless i change the policy-map:

3)

policy-map type loadbalance first-match L7-10-1-1-1

class class-default

no sticky-serverfarm sticky-farm

sticky-serverfarm sticky-farm

I don't think this works as described in the docs.

Sven

CSCsw96035 secondary cookie not sticked if added after adding sticky to LB policy

This was identified earlier this year but we haven't assign an engineer to it yet.

I'll make sure this is done.

G.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: