Several sites, some of which use cookies, visited several times. For each request, the browser looks in its cookie store: if it has a live cookie for that site it sends Cookie; if not, the server may answer with Set-Cookie. Follow the decision, the messages and the store.
Two headers with two roles: the cookie tells the server that it is the same browser (it joins the visits); Referer tells it which page each request came from (it names them). Without the cookie, two anonymous requests; without Referer, the same browser but unknown pages.
An HTTP cookie simulator with several web sites, each with a page and embedded objects that may be hosted by another site (third-party cookies), visited several times. A site that uses cookies answers the first request that arrives without its cookie with Set-Cookie (name=value and, if given, Max-Age); the browser stores a row (site, name=value, expiry) in its cookie store and from then on sends Cookie in every request to that site: the objects, later visits and requests made from pages of other sites. A cookie is never sent to another site. When it expires (Max-Age) or, for a session cookie, when the browser closes, it is deleted and the server assigns a new identifier. The visualization shows the decision tree for each request, the browser–servers sequence diagram with the Cookie, Set-Cookie and Referer headers, the cookie store before and after each visit and what each server knows (third-party tracking). It includes the class example, figure 2.10 of Kurose and Ross, third-party tracking, the session cookie, random exercises and SVG/PNG export.
Concepts: HTTP cookies, Set-Cookie, Cookie, cookie store, Max-Age, session cookie, third-party cookies, tracking, Referer, state on top of HTTP.
Formulas:
Cookie in the request ⇔ the store has a live cookie for that site (age < Max-Age, or session cookie without closing the browser)Set-Cookie in the response ⇔ the site uses cookies and the request arrived without its cookieNetwork Architecture I, Session 2.3 · Enrique de la Hoz, University of Alcalá · License CC BY-SA 4.0 · Source and catalogue on GitHub · DOI 10.5281/zenodo.23285664