Zebra_Session is a PHP class that acts as a wrapper for PHP’s default session handling functions. Instead of storing session data in flat files, it stores them in a MySQL database, thus providing both better security and better performance. The Zebra_Session class is also a solution for applications that are scaled across multiple Web servers (using a load balancer or a round-robin DNS) and where the user’s session data needs to be available, since storing sessions in a database makes them available to all of the servers. Zebra_Session‘s code is heavily commented and generates no warnings, errors, or notices when PHP’s error reporting level is set to E_ALL.
|Tags||sessions PHP classes Scripts user authentication|
|Operating Systems||OS Independent|
Release Notes: This release fixes a bug which made sessions' lifetimes twice as long as expected, adds details on how to preserve session data across subdomains to the documentation, and makes the messages related to database connection errors more meaningful.
Release Notes: The constructor method now accepts an optional link argument which must be a MySQL link identifier. By default, the library made use of the last link opened by mysql_connect(). On some environments (particularly on shared hosting) the "last link opened by mysql_connect" was not available at the time of the instantiation of the Zebra_Session library. For these cases, supplying the MySQL link identifier to the constructor method will fix things. The documentation was corrected and expanded.
Release Notes: This release implements session locking, a way to ensure that data is correctly handled in a scenario with multiple concurrent AJAX requests.
Release Notes: This release fixes a small bug in the destroy method: the script would trigger a PHP notice if the HTTP_USER_AGENT value was not available in the $_SERVER super-global. It adds a new method “get_settings” that returns the default session-related settings for the environment where the class is used. The class will now trigger a fatal error if a database connection is not available. The class will now report if MySQL table is not available. The constructor of the class now accepts a new argument, tableName; with this, the MySQL table used by the class can be changed.
Release Notes: 'LIMIT 1' has been added to the read() method, increasing the performance of the script.