Hey everyone,
Sorry if this seems vague, but I'll do my best to clarify. I'm a junior developer learning backend web development and I'm working on an authentication system for my project.
To give you some context:
- I'm setting up a signup/login flow using Supabase.
- I am utilizing Supabase's Auth Management HTTP API instead of their frontend SDK.
- The process goes like this:
1. The client sends an HTTP request to my server with the user's credentials.
2. My server validates these credentials and processes them.
3. After that, it makes an HTTP request to Supabase for signup or login.
4. If Supabase sends back a JWT, my server needs to return this JWT to the client.
This is a high-level overview, omitting extra steps for simplicity.
Here's the part where I'm confused:
I thought I'd need to track requests with correlation IDs or session tracking, but I'm beginning to think the HTTP protocol might manage this automatically—though I'm not entirely sure how.
Can someone explain how this works? Does each HTTP request maintain a unique response context even with multiple users? Or do I need to keep track of which request belongs to which user?
Thanks in advance!
1 Answer
The way this works is due to the underlying TCP/IP layer that handles your HTTP requests. Each connection between your client and server is unique due to the combination of local and remote IP addresses and ports. Essentially, when a new request comes in, even if from multiple users, the server treats each as its own separate context, often in its own thread. This means the server can manage responses for each client without confusion, even during high traffic!
Got it! So it's all about the unique connections separating the requests. Thanks for explaining that!