CST463 · S7 CSE
Cookie management lifecycle
How a cookie is created, read, updated and deleted between the browser and the PHP server.
Source: php_cookie_management.pdf — course material by Kiran V.K., published here so it is readable without a Google account.
The cookie lifecycle as covered in class — how a cookie is created, read, updated and deleted across the request/response cycle between the browser and the PHP server.

The sequence, in words
- Creation — the PHP server receives a request to create a cookie and replies with an HTTP response carrying a
Set-Cookieheader; the browser stores it. - Reading — every subsequent request from the browser carries the cookie, and the server reads it through
$_COOKIE. - Modification — the server sends a new
Set-Cookieheader and the browser updates its stored value. - Deletion — the server sends a
Set-Cookieheader with an expiry in the past, and the browser deletes the cookie.