Download & Extend

Disable session expire for certain roles?

Project:Session expire
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (won't fix)

Issue Summary

I was using autologout module and there was an option which allowed set up to which roles it applies, but I can't find it here, it's only anonymous / anonymous + authenticated choice. That would be nice feature I reckon…

Comments

#1

+1 - would love to have this option per role. Great work!

#2

Status:active» closed (won't fix)

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

#3

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

AttachmentSize
session_expire.module.txt 8.23 KB