Q&A

Q1: Are any serious security or privacy issues raised by cookies?
A1: A server can access only a cookie set from its own domain. Although a cookie can be stored on the user’s hard drive, there is no other access to the user’s file system. You can, however, set a cookie in response to a request for an image. So, if many sites include images served from a third-party ad server or counter script, the third party might be able to track a user across multiple domains.
Q2: The query string looks ugly in the browser window. Would it be true to say that cookies are the neatest way of saving state?
A2: Unfortunately, it isn’t that simple. At best, cookies are a transparent way of saving state. Some users, however, set their browsers to warn them ...

Get Sams Teach Yourself PHP in 24 Hours, Third Edition 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.