Hi Folks,

Would like to put this idea out there and see if (many) others might find it useful as well.

My goal with using the "cookie" persistence is to only set the persistence when it's necessary. When there is no session established, allow the balance scheme to send to any available server.

In most cases, using the "postonly" method works for me, as the client POST is a clear indication that a session is likely going to be created.

This doesn't cover all of the cases, unfortunately. While I might consider using the "prefix" mode, that's not guaranteed to work reliably, as the persistence cookie needs to match the session cookie issued by the server, and not all sites use the same session cookie.

What I believe would work, however, is to use a mode similar to "postonly", that would cause the persistence cookie to be emitted to the client when a "Set-Cookie" response was received by the backend server. In this way, any session initiated by any cookie would correspond to a persistence cookie, without waiting for the client to POST data. This would cover the fairly common scenario where a cookie is necessary BEFORE the first POST by the client - the ubiquitous example would be the "wordpress_test_cookie", without which one cannot log in to WordPress using the default login method.

Or, perhaps it might be more generally useful to have the "cookie" option use the standard "if ACL" syntax to allow operators more flexibility in choosing when to set a persistence cookie, without having to hard-code options.

Best,
Mark

Reply via email to