Re: Sticky session, dumb client

From: Willy Tarreau <w#1wt.eu>
Date: Wed, 28 Oct 2009 06:16:26 +0100


On Tue, Oct 27, 2009 at 08:37:38PM -0400, Robinson, Michael wrote:
> Thanks for the reply, Aleks.
>
> appsession lookup in URL does not seem to work for me.
>
> The request, as it appears in HTTP access_log:
>
> 64.88.170.40 - - [28/Oct/2009:00:22:04 +0000] "POST /app;jsessionid=813FD588059604BD3D519A11A0C1FA7B.10.250.54.70 HTTP/1.0" 200 1002 "-" ""
>
> And from haproxy.log:
>
> Oct 28 00:18:20 127.0.0.1 haproxy[18330]: 127.0.0.1:46652 [28/Oct/2009:00:18:20.441] www www/i-c05ddda8 0/0/0/2/2 200 495 - JSESSIONID=7537BF152E4E826BBD0672DE3AC1A4CE.10 ---- 0/0/0/0/0 0/0 "GET / HTTP/1.1"
>
> My haproxy.cfg:
>
> ...
> # when cookie persistence is required
> #cookie JSESSIONID prefix
> appsession jsessionid len 32 timeout 10800000
> option httpclose
> capture cookie JSESSIONID len 46
> # Example server line (with optional cookie and check included)
> server srv1 10.253.43.224:8000 cookie srv1 check inter 2000 rise 2 fall 3
> server srv2 10.253.43.224:8000 cookie srv2 check inter 2000 rise 2 fall 3
> ...

Stupid question : is it normal that your cookie name is upper case and that the url cookie name is lower case ? That's what you have in your trace too, but I'm fairly certain that cookie names are case-sensitive.

So basically your application is doing a SetCookie: JSESSIONID=xxx and setting "jsessionid=xxx" in URLs, but those two are different cookies. Since you have configured appsession to check only jsessionid and it never sees it in responses, it will never learn it and will never match it.

You have to fix the application at this point.

Regards,
Willy Received on 2009/10/28 06:16

This archive was generated by hypermail 2.2.0 : 2009/10/28 06:30 CET