bed
bed

Reputation: 81

Automatic logout after inactivity Drupal 8

I'm creating a new site in Drupal 8 where users can login. For security reasons I would like to create a custom module that closes the inactive 3 minutes user session. I've already tried to use the Automatic Logout module, but it's not for me, becouse i have a custom login. Does anyone have an idea of how it can be created?

Thank you

Upvotes: 0

Views: 1812

Answers (1)

Bernhard
Bernhard

Reputation: 1870

It's easy to make with JavaScript:

<script>
 setTimeout(function(){                                 // set a timeout-event
  window.location.href = "http://example.com/logout/";  // make a redirect to the logout page
 }, 180000);                                            // set timeout to 3 minutes ( 1000 * 60 * 3 )
</script>

Upvotes: 1

Related Questions