O'Reilly logo

PHP for Teens by Maneesh Sethi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12. Cookies

PHP has many functions and abilities for web sites. One of these capabilities is to create and use cookies. You may have heard of cookies while using your web browser. A cookie is a text file stored on the user’s machine. This text file has a data value, which stores some small amount of data. You just load this text file as a variable on pages that use the cookie, and that is your stored data! The text file is stored, in a hidden spot, by your web browser.

Basically, a cookie is a way for a site to save some data on your computer. This can be good and bad. For example, a lot of spyware sites use cookies to keep track of where you visit and use this data to sell ads to you. Also, make sure you don’t overdo it: A lot of people ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required