Sessions with MySQL

From: Date: Tue, 28 Aug 2001 08:38:28 +0000
Subject: Sessions with MySQL
Groups: php.general 
Request: Send a blank email to php-general+get-64747@lists.php.net to get a copy of this message
I'm using a MySQL-database to store my session variables by using the following code: session_set_save_handler "sess_open", "sess_close", "sess_read", "sess_write", "sess_destroy", "sess_gc" ); session.gc_probability in the php.ini file is set to 1. In a book I read that this means that the function sess_gc will then be call everytime I start a new session by using: session_start(); But the function sess_gc will never be called so my table including the session variables is growing up and never be cleaned. Only if I call the sess_gc function myself the old sessions will be deleted. Do I always have to do this myself or what's wrong with my code?

« previous php.general (#64747) next »