O'Reilly logo

Core PHP Programming, Third Edition by Leon Atkinson

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

7.7. Cookies

Cookies are small strings of data created by a Web server but stored on the client. In addition to having names and values, cookies have an expiration time. Some are set to last for only a matter of minutes. Others persist for months. This allows sites to recognize you without requiring a password when you return. To learn more about cookies, you may wish to visit Netscape's site <http://developer.netscape.com/docs/manuals/communicator/jsguide4/cookies.htm>.

Using cookies with PHP is almost as easy as using form fields. Any cookies passed from the browser to the server are converted automatically into entries in _COOKIE and _REQUEST.

If you wish to send a cookie, you use the setcookie function, described in Chapter 8. The Web server ...

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