PHP
Remembering Users (Cookies and Sessions)PHP - Remembering Users (Cookies and Sessions)
Remembering Users (Cookies and Sessions)
Understanding Cookies
Creating a Cookie
Reading Out Cookies
Getting Rid of "Magic Quotes" in Cookies
Setting a (Reasonable) Expiry Date
Setting a Client-Specific Expiry Date
Deleting a Cookie
Making Cookies Accessible for Several Domains
Checking Whether the Client Supports Cookies
Saving Multiple Data in One Cookie
Saving the User's Language Preference
Understanding Sessions
Where to Store the Sessions
How to Maintain the Session State
Activating Sessions
Reading and Writing Sessions
Closing Sessions
Changing the Session ID
Creating Dynamic, Session-Aware Links
Implementing a Custom Session Management
Creating a Secured Area with Sessions
Creating a Secured Area Without Sessions
Files on Server File System
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.