Not sure if this should be a support request or a bug report.
In testing the 6.x-1.x-dev version (2009-Sep-04)
The cleaner settings page identifies there are abandoned sessions but when cron is run manually the sessions are not cleaned and the log entry "Cleaned 0 sessions" is created.
Initially the module identified there were 256 abandoned sessions when the sessions table itself had almost 2000 entries. After truncating the sessions table cleaner module identified a couple of abandoned sessions that fit with expectations. Still module does not clean sessions and log entry is "Cleaned 0 sessions". Also the number of abandoned sessions doubled.
Thanks for the module,
Izzy
Comments
Comment #1
izmeez commentedLetting the module run on scheduled settings also does not clean the sessions and it now appears as though the original abandoned sessions are being added each time not doubled.
[Edit] Not sure this is at all true. The number of abandoned sessions seems to rise fairly quickly. Can this be related to the cron tasks that are actually active?
Comment #2
izmeez commentedMaybe I was misunderstanding what this module is supposed to do.
All entries in watchdog show 0 sessions cleaned. Is this because Drupal cron is cleaning the the sessions with garbage collection turned on based on the session.gc_maxlifetime which is set to 200000 by default and that this is leaving nothing for cleaner to do with the sessions?
Comment #3
nancydruIndeed, we will not delete a session that is less than that setting. This is because we have no way of knowing if a session is truly abandoned or may still be in use. If you know of a way of identifying them, we can certainly add a check to do so.
On most of my sites, I have lowered the setting to one week, and on some to even shorter intervals.
Comment #4
izmeez commentedThanks for the response.
So, this means that if for some reason the garbage collection is not active or leaves some sessions then cleaner will remove them, right?
In that case, since I can confirm that garbage collection is working I will not need cleaner to do this.
I guess the status should be changed to "By design". I wonder if this should be included in the documentation.
Thanks,
Izzy
Comment #5
nancydruI occasionally see cases where garbage collection fails to clean them up, but it is not very common. At any rate, clearing a session that may still be active could get you some angry customers; that's why we don't do that.
Comment #6
nancydruI was using this on my client's site and discovered that it was indeed not properly deleting sessions. I have applied a fix that made it work here.
Comment #7
izmeez commentedThanks. Is the fix in the latest dev version?
Comment #8
nancydruIt should be.
Comment #9
izmeez commentedI tested the latest dev version and it appears that it clears all sessions including active user sessions except user1.
This is not good, so I have changed the category to "bug report" and and status to "needs work". Thanks,
Izzy
Comment #10
nancydruIn testing trying to create a D7 version, this function seems to be working fine for me
Comment #11
valentine94