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

izmeez’s picture

Letting 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?

izmeez’s picture

Maybe 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?

nancydru’s picture

Status: Active » Postponed (maintainer needs more info)

Indeed, 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.

izmeez’s picture

Thanks 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

nancydru’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

I 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.

nancydru’s picture

Status: Closed (works as designed) » Fixed

I 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.

izmeez’s picture

Thanks. Is the fix in the latest dev version?

nancydru’s picture

It should be.

izmeez’s picture

Category: support » bug
Status: Fixed » Needs work

I 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

nancydru’s picture

Status: Needs work » Postponed (maintainer needs more info)

In testing trying to create a D7 version, this function seems to be working fine for me

valentine94’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (won't fix)