MODULE 06 · AUTHENTICATION & SECURITY

Session

A server-side record that helps a web application keep track of a user's interaction across requests.

01 · What is it?

A session is temporary state that a server associates with a browser or user across multiple requests.

The browser usually sends a session identifier, while the server keeps the related session data in memory, a database, or a session store.

02 · Think of it like...

A coat-check ticket

Imagine leaving a coat at a coat check. The staff keep the coat; you keep a small ticket that helps them find it later.

A web session works similarly: the server keeps the temporary state, and the browser carries an identifier.

03 · What does it do?

A session lets the server recognize related requests and retain short-lived information while a user interacts with an application.

Keep Login State

Remember that a user has signed in.

Store Temporary Data

Hold a cart, draft, or multi-step form state.

Link Requests

Associate several requests with one interaction.

Expire State

Remove access or data after a timeout or logout.

04 · Where is it used?

Sessions are common wherever a web application needs temporary, user-specific state.

AuthenticationSigned-in websites

Keep a user signed in between page requests.

ShoppingCart state

Remember items while a shopper moves through checkout.

WorkflowsMulti-step forms

Carry progress from one step to the next.

SecurityTemporary controls

Store short-lived state such as a sign-in or verification step.

05 · Example

1. A user submits a login form.

2. The server verifies the password and creates a session record.

3. The server sends a session identifier to the browser.

4. A later request includes that identifier.

5. The server loads the session and applies the user's signed-in state.

User Login
Session Record
Session ID
Later Request
Server Finds Session

The identifier is a pointer to session state; it is not the session data itself.

06 · How it connects

Browser
Session ID
HTTP Request
Session Store
Application

A cookie is one common place to carry the session identifier. The session data remains under server-side control.

07 · Do Not Confuse

Session

Temporary state associated with a user or browser across requests.

Cookie

Small browser data that can carry a session identifier to the server.

Authentication

The process of checking who a user is; a session may preserve the result.

Session = server-side continuity; Cookie = one possible browser-side carrier.

08 · Topic Glossary

ENGLISH TERM中文SIMPLE ENGLISH中文小白理解
Session会话Temporary state kept across related requests.在多次相关请求之间保存的临时状态。
Session ID会话标识A value used to find a session record.用来找到对应会话记录的一串标识。
Session Store会话存储A place where session data is kept.保存会话数据的地方,例如内存、数据库或专用存储。
CookieCookie / 浏览器 CookieSmall browser data that can carry a session ID.可以携带会话标识的浏览器小数据。
Authentication身份认证The process of checking who a user is.判断用户身份是谁的过程。
Timeout超时A limit after which a session may expire.超过一段时间后,会话可能失效的限制。
Logout退出登录An action that ends a user's signed-in state.结束用户登录状态的操作。
State状态Information describing a system or interaction at a point in time.描述系统或用户操作当前情况的信息。

09 · What to Remember

A session gives a web application temporary continuity across requests.

The browser usually carries an identifier, while the server controls the session data and its lifetime.

Core Flow:
Browser → Session ID → Request → Session Store → Application

↑