Skip to content
BENIBIX Learn

Session (Web)

Development🔑 AuthSessions and Tokens

Also known as Session, User Session, Session ID, Session Cookie

How a site remembers you are logged in as you move from page to page.

Think of it like

Think of it like a cloakroom ticket. You show the number, and they know which coat is yours.

Example

Emma logs in once and then opens 20 pages. Each request carries her session cookie, so she never has to log in again.

Why it matters

HTTP forgets each request once it is done. Sessions are what make a login last.

Definition

A session is how a website remembers you are logged in from one page to the next. After you log in, the server makes a random session ID and keeps your details beside it. Your browser stores that ID in a cookie and sends it with every request. The server looks it up and knows it is you. Logging out deletes the session on the server.

Common mistake

Keeping sessions alive for good. End them after a while, so a stolen cookie stops working.

Key takeaways

  1. 1
    A random ID. Kept in a cookie.
  2. 2
    Details on the server. Looked up each time.
  3. 3
    Ends on logout. Or when it expires.

Compare