Would it be possible to add a feature where a new session will simply be rejected as long as the previous sessions exist? I am hoping to use this in conjunction with the Automated Logout to control how long the sessions can last. I dont want the users to even have the option to force an earlier session to be disconnected. They will simply have to wait until a session become available.

Is this possible? Thanks!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Liam McDermott’s picture

Status: Active » Needs review

And here's a patch!

Note: I had to use session_destroy(); instead of session_limit_invoke_session_limit(session_id(), 'disconnect'); as the session would not properly be destroyed otherwise, and the user would still appear logged-in.

Liam McDermott’s picture

Would help if I attached the file! :)

RikiB’s picture

Status: Needs review » Reviewed & tested by the community

This is perfect, it adds a 3rd options in the admin section which gives you the option to prevent new sessions once they are filled. Thanks Liam! :D

deekayen’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

marynz’s picture

Hi
thanks for this module and patch, was just what i needed - works great.

Is there a way to make sure user 1 doesn't get locked out? I found myself blocked - used the back button in the browser to get back to an admin page then and logged out and back in a couple of times before the log in was successful.

in the meantime ill use cleaner module to clear old sessions every time cron runs, that way at least i will eventually be able to log on again...

mary