A code editor with syntax highlighting, representing a web session.

How a website remembers you between clicks.

What a web session is

A web session is the way a website keeps track of who you are and what you are doing as you move from page to page. Without it, a site would forget you the instant you clicked a link, asking you to log in again on every page. A session ties your series of requests together into one continuous visit, so the site can remember that you are logged in, what is in your shopping cart, and your preferences.

Why it is needed

The web runs on HTTP, which is stateless: each request a browser makes is independent, and the server has no built-in memory that two requests came from the same person. That design keeps the web simple and scalable, but it means a site needs an extra mechanism to recognize a returning visitor across requests. Sessions are that mechanism, layered on top of the stateless web to create a sense of continuity.

Sessions and cookies

Sessions usually work hand in hand with cookies. When your visit begins, the server creates a session and gives it a unique session identifier, a long random string. It sends that identifier to your browser as a cookie, which the browser then includes automatically with every later request. The server reads the identifier, looks up your session, and instantly knows who you are, without you noticing any of it.

Where the data lives

The session identifier is just a key; the actual session data, such as your user identity and cart contents, is typically stored on the server, in memory, a database, or a fast store like Redis. Keeping the real data on the server is safer, because the browser only holds a meaningless identifier. An alternative approach stores the data in the token itself, as with JWTs, trading server storage for a self-contained token.

Security and expiry

Because a session identifier effectively stands in for your login, protecting it matters. If someone steals it, they could impersonate you, an attack called session hijacking. Sites defend against this by sending cookies only over secure connections, marking them so scripts cannot read them, and expiring sessions after inactivity. This is also why logging out and avoiding untrusted public computers for sensitive accounts is good practice.

The bottom line

A web session lets a stateless website remember you across pages by assigning a unique identifier, usually carried in a cookie, that links your requests into one visit. The real data lives on the server, keyed by that identifier. Understanding sessions explains how sites keep you logged in and your cart intact, and why protecting the session identifier is central to staying secure online.

See also: What is a cookie? Explained, What is a JWT (JSON Web Token)? Explained.

Sources

Published date reflects the original event date (2026-10-23). This article is original Skillo editorial written from the sources above; facts were verified in September 2026.

Skillo Staff

Skillo Staff

All stories by: Skillo Staff

Leave a Reply