advancedScenario Questions

Scenario 27: After scaling from one server instance to three behind a load balancer, users report being logged out mid-session at random.

With traditional stateful (session-cookie) authentication and no sticky sessions or shared session store, a user's in-memory session on instance A isn't visible if the load balancer routes their next request to instance B. Fix with either load-balancer sticky sessions or, more robustly, externalizing sessions with Spring Session backed by Redis so any instance can serve any authenticated request.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Spring Ecosystem Mastery library.

Scenario 27: After scaling from one server instance to three behind a load balancer, users report being logged out mid-session at random.

Next Step

Continue to Scenario 28: Your application needs to authenticate a WebSocket connection used for real-time account balance updates.← Back to all Spring Security questions