From the course: HTTP Essential Training
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Cookies
- [Instructor] To get an idea of how headers are used to perform actions by both servers and browsers, let's look at two examples. First up, cookies. As I've explained before, cookies are used to pass states between clients and servers over the state less ATTP protocol, effectively setting up sessions between the server and client. Let's say I have a website with a login panel and once someone has logged in, I want their browser to remember that and authenticate itself by telling the server who it is and that it's already in a logged in state. This can be done using a cookie. When the user first goes to the site, they are met with a login panel. They put in their username and password and the site lets them in. At this point, the server includes a set cookie response header with a unique token or string of characters in its response and also stores that same string in its own database associated with the current logged in user. The browser receives this cookie and keeps it in its…