# Session (Web)

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

**Field:** Software Development  
**Category:** Auth  
**Also known as:** Session, User Session, Session ID, Session Cookie

## Think of it like

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

## 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.

## 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.

## Common mistake

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

## Three principles

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

## Related terms

- [HTTP Cookie](https://learn.benibix.com/term/development/cookie)
- [Authentication](https://learn.benibix.com/term/development/authentication)
- [Access Token](https://learn.benibix.com/term/development/access-token)
- [HTTP Request](https://learn.benibix.com/term/infrastructure/http-request)
- [Session Hijacking](https://learn.benibix.com/term/development/session-hijacking)

## Told apart from

- [Session vs JWT](https://learn.benibix.com/compare/session-vs-jwt): A session keeps your login on the server, while a JSON Web Token carries it inside the token. With a session, the browser holds only an ID. The server looks it up on each request. A JWT holds the facts and a signature, so the server can check it with no lookup. A session can be ended at once; a JWT stays good until it runs out.

---

Source: https://learn.benibix.com/term/development/session
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
