DEV Community

Hermit
Hermit

Posted on

AWS elb sticky session over IP

Hi all,

I am facing a challenge in configuring sticky session on AWS ELB. The problem statement which I have is, I want sticky session over IP and not over application. What I mean by that is, if a request is coming from same IP of a particular user , like even though browser tab/window change, the sticky session should work.

In my application (which runs on say https://app.in), the authentication method uses third party app (which runs on say, https://auth.in). So when the login page loads, the session gets created at the server (say box1 - one of EC2 boxes). The user clicks on login button and a new window pops up (with domain https://auth.in). The user now has to enter credentials details in https://auth.in and the verification request should go to box1 only (backend for auth and app both are running on all the boxes). But what is happening is, as soon I setup ELB, the session gets created at box1 but the verification request goes to Box2. Due to which the user never gets verified.

Can this scenario be solved using sticky session?

TIA.

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay