Loading Depth Study
Preparing your workspace
Sessions and cookies allow a server to recognize an authenticated browser across multiple HTTP requests.
HTTP is stateless, so applications need a mechanism to remember authenticated users. A common approach is to store an opaque session identifier in a secure cookie while the server stores or can retrieve the corresponding session state. Important cookie protections include Secure, HttpOnly, and appropriate SameSite settings. Session identifiers should be difficult to guess, rotated when appropriate, and invalidated on logout or other security events.
After logging in, a student can visit several protected pages without sending their password on every request.
Set-Cookie: session_id=abc123; HttpOnly; Secure; SameSite=Lax; Path=/
The browser receives a protected cookie that can be used for session-based authentication.