When I look at my database and the size of it, it seems that the session table uses up the biggest chunk (far bigger than all nodes).
Is there a reason the session IDs have to be stored in the database? If so, how do I set it up, so that the sessions expire and get deleted from the table sooner?

Andre

Comments

LeeMcL’s picture

In your site settings file (sites/default/settings.php) look for
the following around line 100:

ini_set('session.gc_maxlifetime',   200000);

Replace it with the following:

/* Lee added these to force a session expire on every session update */
/* Session gc's are cheap under drupal so this isn't a problem on all but
 * the busiest sites - yet to be confirmed */
ini_set('session.gc_probability',   1);
ini_set('session.gc_divisor',   1);
/* Lee and added this to expire sessions inactive for more than 1 hour */
ini_set('session.gc_maxlifetime',   3600);

You will probably want to change gc_maxlifetime to something more appropriate to your site.

andre75’s picture

Wow, thanks. Exactly what I was looking for ;-)

-------------------------------------------------
http://www.opentravelinfo.com
http://www.aguntherphotography.com