In this lesson I will show you how to set a cookie in PHP. The process is relatively easy and can be used for some incredibly useful tracking of information. However, recent changes in EU legislation means that you must now make users aware of and consent to the use of cookies if you live in the EU and your site uses cookies.