views:

22

answers:

0

My challenge is the following. I'd like to uphold the Post/Redirect/Get pattern for posted forms, but after the redirect I still want to show the state of the form in case of invalid fields. This information can be passed by storing it in session quite easily.

However these sites usually run on multiple webservers behind a load balancer, which are configured NOT to be sticky. There is also no shared session state on purpose.

To use local session state on the webservers would be preferrable for scalability, but to do that you need sticky sessions. Sticky sessions are however a hindrance to the people who manage the servers, because after removing some servers from the load balancer to do a release, they still have to wait some 10 to 15 minutes before all sessions have ended. Without stickiness it's almost instantaneously.

What would be really cool is if we could make the session sticky for just one single subsequent request after a POST or REDIRECT. Or even have total control over when to enable or disable stickiness from code.

Does anyone know if this behaviour is possible? By settings a certain cookie perhaps? Or some http header?

related questions