Sessions: How the Next Page Remembers Your Visit
A web session connects a series of requests and responses into an ongoing interaction with an application. It lets the next page recognize information associated with the visit, such as a language choice or a successful sign-in. The session supplies continuity that the web's underlying request rules don't provide on their own.
Those rules are called HTTP, Hypertext Transfer Protocol. A browser asks for something; a server responds. HTTP is described as stateless because the meaning of a request can be understood independently of the requests before it.
That doesn't prevent a website from remembering information. It means the application needs an additional way to connect its interactions. The HTTP specification also makes clear that a relationship between connections doesn't establish a user's identity.
- Learn to find the flaws in a web app before someone else does.
- Understand injection, broken logins and logic bugs well enough to fix them.
- Build the skills that web security jobs ask for.
A short identifier points to a longer story
In a server-stored session, the application keeps information about the visit and gives the browser a session identifier. The identifier is a value that points back to the session's stored information.
A cookie can carry that value. A cookie is a small piece of data the browser stores and sends with matching requests. The cookie, the identifier inside it and the information retained by the application are different parts of the arrangement.
For example, suppose a visitor chooses a language on the first page. The application could retain that preference in its session record. When the browser asks for the next page and supplies the identifier, the application finds the record and uses the saved choice.
The identifier needn't contain the language choice itself, the contents of a shopping cart or the user's password. Its job can be simply to connect the request with the right record.
This is one session-storage model, not the only possible implementation. The software-security organization OWASP describes it in its session-management guidance.
The visit can begin before the login
A visitor doesn't have to identify themselves for an application to maintain a session. Anonymous sessions can retain information about an ongoing visit.
A successful login adds an authenticated state: the application has checked evidence of the user's claimed identity. Authentication answers that identity question; the session lets later requests continue from the accepted check.
Longer-lived account data is separate again. A saved shopping cart might be associated with an account and appear on another device after sign-in. That doesn't prove that one browser session has traveled between the devices. The account can retain information beyond the lifetime of any particular session.
This distinction explains why ending a visit doesn't necessarily erase everything the service knows about an account. Session continuity and durable account storage serve different purposes.
Sessions or JWTs: Where Does Your Login Actually Live?
The server decides when the identifier stops working
A session can have an idle timeout, which measures inactivity, and an absolute timeout, which limits its total age. OWASP recommends enforcing both on the server rather than relying on a browser to keep time honestly.
The difference matters. Continued requests can keep an idle session active, while an absolute limit can still require the session to end.
Explicit logout should invalidate the session so its identifier is no longer accepted. Closing a tab or browser isn't a reliable substitute: the server may never receive a dependable instruction to end it.
Browser Cookies: What They Remember About You

Session Hijacking Can Bypass the Password Question

Form-Based Authentication: What Happens After “Sign In”?

QUOTE:
"Amateurs hack systems, professionals hack people."
