Web Authentication & Session Security
Explore the difference between authentication and authorisation, and how web sessions should be protected.
Educational reference drafted for the Nullwire archive. This is not a claim of completed training or original research; verify examples and customise before presenting it as finished work.
Objective
Understand what a secure web application needs to establish identity, grant access and end access reliably.
Authentication is not authorisation
Authentication checks that a visitor presents valid credentials. Authorisation decides whether that visitor may access a specific resource. Both checks must happen on the server for protected content.
A visually hidden link is not an access control. A password form that only reveals already downloaded content is not a secure gate.
Session fundamentals
After a successful login, a server can issue a signed session token in a cookie. Common cookie protections include:
HttpOnlyto limit JavaScript access.Secureto send only over HTTPS.SameSiteto constrain some cross-site request behaviour.- A short expiry appropriate to the resource.
These settings support a secure design but do not replace server-side verification.
Threat model
Consider credential guessing, token theft, session fixation, accidental caching and unauthorised direct file downloads. Apply rate limiting, session rotation, CSRF defences where appropriate, and Cache-Control: no-store on sensitive responses.
Example request flow
Visitor -> POST /login -> Server validates secret
Server -> Sets protected cookie
Visitor -> GET /private/document
Server -> Verifies session and authorisation
Server -> Returns private content or 403
Practice questions
- Does the document URL work without a cookie?
- What happens when a code or signing secret rotates?
- Can intermediary caches store sensitive responses?
- Can a page’s metadata reveal protected information?
Nullwire connection
The planned restricted CV should protect both the online representation and the PDF using server-side checks. The public workstation styling has no security authority.
Related: Cloud IAM & Least Privilege.