tags:

views:

84

answers:

1

Over the last few months, my drupal sessions table has ballooned to several GB. It seems to have started when I upgraded to drupal 5.20 (previously I thought drupal automatically cleaned out old sessions). So I created a cron job to delete sessions older than two weeks, but this takes far too long to execute (the sessions table grows by about a million rows per week). Should drupal actually be handling this, or do I just need to cut down the maximum session age until the execution time is acceptable?

Also, I thought drupal was not supposed to create a session on the first request, thus eliminating many garbage entries for crawlers. But at least a quarter of the session entries are bots.

A: 

It sounds like a bug in your code somewhere. Drupal shouldn't create a session on first request for that exact reason.

Drupal updates are only bugfixes/security fixes for Drupal 6 and lower. So I don't see why upgrading could have caused the problem.

Have you altered Drupal core in any way?

googletorp
Drupal core has been modified in a few places, but nothing that should affect this. I did some more investigating though, and it appears that a contrib module (organic groups) was interfering with drupal's session handling. I updated the module, and that seems to have fixed it!
Brian

related questions