Web and protocol foundations
Stateless HTTP and sessions
A connection is not a user session.
Understand the concept
Stateless HTTP means request semantics do not rely on an implicit conversation history. Applications can still maintain sessions. An opaque cookie identifier can reference server-side user context. Reusing a TCP connection does not identify a user.
Authorise each request after login. Logout requires invalidating the relevant session or renewal mechanism, not merely hiding UI. Distributed systems need deliberate storage, expiry, revocation and device management.
JWTs do not eliminate all state requirements: revocation, key rotation and permission changes remain concerns. Controls such as rotating session identifiers at login help prevent fixation. Never equate a transmitted identity with permission to perform an operation.
For login design and load-balancing decisions.
Assuming stateless HTTP prevents application sessions.
One topic. Three levels of depth.
GET /account HTTP/1.1
Host: example.test
Cookie: session=opaque-exampleEach request carries identity context.
This page does not send requests to external servers. Messages are readable HTTP/1.1 illustrations, not HTTP/2 or HTTP/3 wire dumps. example.test is reserved for examples. Run commands and JavaScript only in your own test environment; never publish real tokens or cookies.
Try it yourself first.
Can one connection carry requests associated with different users?
Show the solution and explanation
Connection identity ≠ application identityYes; never infer user permissions from connection reuse.