Headers and cookies
Alongside the main content, every request and response carries headers — small labeled notes with extra information. They're like the writing on an envelope, separate from the letter inside. Headers say things like what format the content is (Content-Type: text/html), or who's asking.
A cookie is one specific, important use of headers. The web has a short memory: by default, each request stands alone and the server forgets you the instant it answers. A cookie fixes that. After you log in, the server hands your browser a small — a cookie — and your browser automatically sends it back with every future request. That's how a site "remembers" you're logged in across pages. No cookie, no memory; you'd have to log in on every single click.