Concept Flow - Setting and reading cookies
Start PHP script
Set cookie with setcookie()
Send HTTP headers with cookie
Browser stores cookie
Next request: browser sends cookie
Read cookie from $_COOKIE superglobal
Use cookie value in script
End script
The script sets a cookie which the browser stores and sends back on next requests, allowing the script to read it from $_COOKIE.