Problems with Cookies

Before using cookies in an application, you should be aware of the problems associated with cookies. For these reasons—and others that may crop up in the future—you should be careful to design your Web pages and CGI programs so that cookies are entirely optional.

For example, if you're using cookies to store a user's preferences, you should use a default set of preferences if cookies are not available. Code defensively.

Cookies Are Ephemeral

As I've mentioned throughout this hour, cookies are ephemeral. Cookies can be deleted from the user's system, edited by the user, or simply thrown away by the browser for no reason at all.

A browser can accept the cookie, use it for a while, and then simply forget it for no reason at ...

Get Sams Teach Yourself Perl in 24 Hours 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.