Web Development
web
security
authentication
What is Session?
Definition
A session is a server-side data store associated with a specific user, identified by a session ID stored in a cookie. It maintains state across stateless HTTP requests — tracking login status, shopping carts, and user preferences.
Why It Matters
Sessions are the traditional alternative to JWTs for authentication. They are more secure against token theft (the server can invalidate them instantly) but require server-side storage and do not scale as easily across multiple servers without a shared store (Redis).