O'Reilly logo

PHP Phrasebook: Essential Code and Commands by Christian Wenz

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 5. Remembering Users (Cookies and Sessions)

Hypertext Transfer Protocol (HTTP) is a stateless protocol. To say it in a simple way: A client (web browser) connects to a web server, sends a request, and gets a response. Then, the connection is closed. The consequence is the next time the same client sends a request to the same web server, it is a new request, so the web server cannot identify the caller. This is, of course, a problem for applications in which state must be maintained, for instance e-commerce applications with a shopping-cart functionality.

However, you can overcome this limitation in several ways. The basic idea is to send some information with the HTTP response; to try to achieve that, this information is sent back with ...

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