Back to Lingo

Session

Sessions

A session is a way for a server to remember information about a user across multiple requests. Since HTTP is stateless, servers need sessions to track authentication, preferences, or temporary data. Sessions typically store a unique ID that maps to server side data or metadata. They are essential for login systems, shopping carts, multi step forms, and personalized experiences. Without sessions, each request would behave as if the user were new. Sessions must be secured to prevent hijacking or impersonation.

How it Works

When a user logs in, the server generates a session record and returns a session identifier, often stored in a cookie. On subsequent requests, the client sends this identifier so the server can retrieve the associated state. Sessions may be stored in memory, databases, or distributed caches. Expiration policies remove inactive sessions for security and scalability. Some systems replace sessions with JWTs when stateless authentication is preferred. Proper session management includes secure cookie settings, rotation, and invalidation on logout.

See More

You need to be signed in to leave a comment and join the discussion