Explore Courses Blog Tutorials Interview Questions
0 votes
in AWS by (12.9k points)

I'm a bit confused about the use of the session stickiness on Amazon Web Services. When I deploy my java web application using Amazon Elastic Beanstalk, I can choose to enable the session stickiness and then specify a cookie expiration period.

My application uses cookies for the session (JSESSIONID) as well as for other small things. Most of the website is accessible only after logging in (I use Spring security to manage it). The website will run on up to 25 small EC2 instances.

Should I enable the session stickiness? If I don't enable it, does it mean that I could be suddendly logged out because the load balancer took me to another server (not the server that authenticated me)? If I enable the session stickiness, do I get logged out when the server that authenticated me gets shut down? Basically, why and when should I use session stickiness?

Thank you very much.

1 Answer

0 votes
by (18.2k points)

Yes, if you don't enable it, you will be logged out because the load balancer will take you to another server.

But if you do enable the session stickiness, you will get logged out when the server that authenticated you gets shut down.

For your case scenario, I think you would want to enable session stickiness because if you don't, each HTTP request from the user's browsers could be routed to some different server.

Related questions

0 votes
1 answer

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

Browse Categories