Over the past few months, my drupal session table has grown to a few GB. It seems to have started when I upgraded to drupal 5.20 (I previously thought drupal automatically cleared old sessions). So I created a cron job to delete sessions older than two weeks, but it is too long to complete (the session table grows by about a million rows per week). Should drupal handle this, or do I just need to reduce the maximum session age until the runtime is acceptable?
In addition, I thought that drupal should not create a session on first request, thereby eliminating many trash entries for crawlers. But at least a quarter of the session entries are bots.
Brian source
share