in reply to Apache::Session::MySQL

From Apache::Session::Store::MySQL:
CREATE TABLE sessions ( id char(32) not null primary key, a_session text );

Replies are listed 'Best First'.
Re: Re: Apache::Session::MySQL
by dkubb (Deacon) on Jan 29, 2001 at 13:33 UTC
    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.