PHP and MySQL
SessionsPHP and MySQL - Sessions
Sessions
Building Applications That Keep State
Managing State in the Client Tier
Cookies
Session Management Over the Web
PHP Session Management
Overview
Starting a Session
Using Session Variables
Ending a Session
Functions for Accessing Sessions in PHP
Session Management Without Cookies
Encoding the session ID as a GET variable
Turning off cookies
Garbage Collection
Configuration of PHP Session Management
Case Study: Adding Sessions to the Winestore
Improving the Client Entry <form>
The Validation Script
Improving error messages
Saving last-entered values as a session variable
The Client Entry <form> Script
Displaying previously entered values
Displaying error messages
The final client entry script
When to Use Sessions
Reasons to Use Sessions
Personalization
Reasons to Avoid Sessions
Need for centralized session store
Bookmark restrictions
Stateful web database applications can be built using
sessions, and session management is the topic of
this tutorial. In this tutorial we:
- Discuss how sessions are managed in the stateless environment of the Web and introduce the three characteristics of server-side session management
- Introduce cookies for storing state
- Show how to use and configure the PHP session management library
- Use PHP session management to improve the client entry <form> in the winestore case study
- Provide a brief list of reasons for using, or avoiding, session management over the Web