Autologout currently only handles fully authenticated users. The attached patch adds support for anonymous sessions, eg a session that has been started for a user that has not yet (and might never) logged in.

Following changes are made by the patch

  • The admin-interfaces now has a number of anonymous-specific configurations
    • Whether anonymous support is enabled
    • Specific timeout for the anonymous role
    • Message that should be displayed when the anonymous user is logged out (it can be confusing for user that has never logged in to be told that he/she is now logged out)
    • Anonymous-specific redirect url
  • A new hook_autologout_anonymous_logout that is invoked when the an anonymous user is "logged out"
  • A new access-callback for the ajax-callbacks that allows anonymous invocation if anonymous support is enabled and a session exists
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

danquah created an issue. See original summary.

danquah’s picture

danquah’s picture

Also attached a patch that applies to 4.4 in case someone needs it, use the patch from #2 for any -dev work.

achton’s picture

DeaOm’s picture

Status: Active » Needs review

Hi @achton. The patch did apply, but does not seems to work. It adds all the settings mentioned for the anonymous user but does not log it out. No message is displayed, no prompt, no watchdog entry. It seems that session is not created for anonymous user, so that is why it's not working for me. (// 3: Anonymous support is enabled, but the session is empty.) I think if the session was created it would work, so I will tag it as needs review, so maybe somebody else can also test it and get different results.