Hi Cyril, On Wed, May 09, 2012 at 08:55:45AM +0200, Cyril Bonté wrote: > Hi, > > Le 09/05/2012 07:04, Baptiste a écrit : > >Hi, > > > >Yes, appsession has been obsoleted by "cookie" and "set-cookie" stick > >tables pattern extraction (in HAProxy 1.5-dev7 as far as I remember). > >As an example: > > > > stick-table type string len 32 size 10K > > stick store-response set-cookie(PHPSESSID) > > stick on cookie(PHPSESSID) > > > >or, better, if your cookie is presented on the query string by the key > >"session_id", then this would do the persistence as well: > > stick on url_param(session_id) > > I may be wrong but I think there are still some points where > "appsession" can't be replaced by stick tables. > > - for example the use of path parameters : > http://example.com/url;jsessionid=XXX > > - the use of cookie prefixes : > I don't see how to match cookies (or path parameters/query string) like > ASPSESSIONIDXXX=<value> (where XXX is dynamic). > > Maybe it still requires some development if we want to replace it by an > equivalent with stick tables.
You're perfectly right. Also the logic in appsession is somewhat different to the logic in stick-tables. For instance, if a client comes with an inexistant cookie and the server replaces it, then the client's cookie won't be learned. With the "request-learn" option, it's even trickier. The client's cookie will be learned from the URL parameter unless the server overwrites it in the response. I think it is fairly acceptable to change this behaviour a bit provided that what currently works still works. After all it's not really a problem if we store old expired entries in the table once in a while. But I want to insist (like you did) on the fact that there is not a 1:1 match right now. Regards, Willy