A slight modification to your CREATE TABLE query, I have used, is something similar to this:
CREATE TABLE sessions
( id CHAR(32) NOT NULL PRIMARY KEY
, length SMALLINT UNSIGNED NOT NULL
, a_session BLOB
, time TIMESTAMP
)
One common problem with using the Apache::Session::* modules is that the storage medium for session information can become quite large.
The addition of the TIMESTAMP field, to the table, tells the database to set the "modified" column to the current date upon an INSERT or UPDATE. This change allows you to reap old session data without having to guess, or use Storable::thaw() to peek at each record in the database, which could be very time consuming.
Update:Changed the SQL query to work with the
newest version of Apache::Session::MySQL. |