Using Cookies

Cookies are a way for a server to store information on the user’s machine so that it can remember the user over the course of a visit. Think of a cookie like a name tag: you tell the server your name and it gives you a sticker to wear. Then it can know who you are by referring back to that name tag.

Among some Web denizens, cookies have a bad reputation because people believe that cookies allow a server to know too much about them. However, a cookie can only be used to store information that the server is given, so it’s no less secure than most anything else online. Unfortunately, many people still have misconceptions about the technology, which can undermine the functionality of your Web application.

In this section you will learn ...

Get PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.