Closed (won't fix)
Project:
Session expire
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Jun 2009 at 18:00 UTC
Updated:
19 Apr 2011 at 12:02 UTC
Jump to comment: Most recent file
Comments
Comment #1
RikiB commented+1 - would love to have this option per role. Great work!
Comment #2
kbahey commentedThe queries to find out and delete session by role will be extremely heavy, since they need to join 3 or 4 tables (sessions, users, users_roles, and maybe role as well). It would bring the site it its knees at cron time.
Comment #3
gzett commentedI want to support the feature request for an option per role.
The selection of the sessions is not that complicated. It need's only a nested SQL query:
e.g. "DELETE FROM {sessions} WHERE timestamp < %d AND uid IN (SELECT uid FROM {users_roles} WHERE rid = %d)"
I've adapted the module as an example, see Attachment. I have devided the job in 2 steps: delete anonymous sessions and delete all or parts of the authenticated sessions. The 2nd part is devided in 3 variants: delete all authenticated, delete only specific roles (without authenticated) and delete all authenticated without specific roles.
The implemented logging options are unnecessary.
Perhaps the change is interesting enough that it will be included in the module :-).