You might have heard about cookies, but what exactly are they, and what can we do with them? In this tutorial, we will focus on the basics of cookies, and learn about their functionality in various web applications and site environments. We will also learn how to work with cookies in PHP.

Cookies vs. Session Variables

Not sure if you need cookies or session variables? Session variables are a way to store data about a user in a database and retrieve it later. Cookies are a way to store data about a user on the user’s computer. Session variables are typically used in applications that need to keep track of a user’s activity. Cookies are typically used in applications that need to store information about a user for a single site.

You can also learn about session variables in my post on using session variables in PHP.

https://code.tutsplus.com/tutorials/how-to-work-with-cookies-in-php–cms-36575