Setting a Cookie

Remembering the user’s name

To make the name available during the following requests, we should set a cookie. This way we can tell the browser to remember the user’s name and send it back to the server when the user makes the next request. Let’s see this in action first. Add the following lines to the beginning of name.php:

Get hands-on with 1400+ tech skills courses.