From the course: PHP with MySQL Essential Training: 2 Build a CMS
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Work with cookies
From the course: PHP with MySQL Essential Training: 2 Build a CMS
Work with cookies
- [Instructor] In this chapter, we're going to be learning about how to work with cookies and sessions in PHP. This is an important topic because cookies and sessions are going to allow us to store data, but more importantly, they're going to be the tools that enable us to perform authorization or user log-ins in the next chapter. So let's start by talking about cookies and learn how those work. You're probably familiar with cookies at least a little bit. A cookie is a small string of data that stored by the user's web browser. And the best way to understand cookies is to watch them in action. So the process begins when a user's web browser sends a request to a web server, and that request would include a header that looks something like this. This is a simplified version, but you can see that we're sending a request to fakesite.com, and it's requesting the page first.php. Nothing special about that, but that's what starts the process. Then when the web server responds back to the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.