PHPackages                             juliomotol/laravel-auth-timeout - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. juliomotol/laravel-auth-timeout

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

juliomotol/laravel-auth-timeout
===============================

Authentication Timeout for Laravel

v4.2.0(1y ago)43132.1k↓12.2%6[4 PRs](https://github.com/juliomotol/laravel-auth-timeout/pulls)MITPHPPHP ^8.1CI passing

Since Apr 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/juliomotol/laravel-auth-timeout)[ Packagist](https://packagist.org/packages/juliomotol/laravel-auth-timeout)[ Docs](https://github.com/juliomotol/larave-auth-timeout)[ RSS](/packages/juliomotol-laravel-auth-timeout/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (15)Versions (22)Used By (0)

Laravel Auth Timeout
====================

[](#laravel-auth-timeout)

[![Latest Version on Packagist](https://camo.githubusercontent.com/94b89d682708476ecbd656f2aac89d89f363ab58f740cfda085999a1de7b553d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a756c696f6d6f746f6c2f6c61726176656c2d617574682d74696d656f75742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/juliomotol/laravel-auth-timeout)[![GitHub Tests Action Status](https://camo.githubusercontent.com/0a776ecddb9734575bcd36062ab2c17732295673d0a835a3f553d24c72b4b58c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a756c696f6d6f746f6c2f6c61726176656c2d617574682d74696d656f75742f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/juliomotol/laravel-auth-timeout/actions?query=workflow%3Arun-tests+branch%3Amaster)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/303394a10e28e805eb2f5004a3f5d37b505f5a821ac6fb4fe942a0c368857a5d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6a756c696f6d6f746f6c2f6c61726176656c2d617574682d74696d656f75742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d6173746572266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/juliomotol/laravel-auth-timeout/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/aa3fcf2393117b767c9a28b4b694a057ab556f43ef9cd89467bf82f697869fc7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a756c696f6d6f746f6c2f6c61726176656c2d617574682d74696d656f75742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/juliomotol/laravel-auth-timeout)

Handle Authentication timeouts in Laravel.

> When upgrading to v4, please see the [CHANGELOG.md](./CHANGELOG.md).

> For Laravel 8+ support, see [v3](https://github.com/juliomotol/laravel-auth-timeout/tree/v3).
>
> For Laravel 6+ support, see [v2](https://github.com/juliomotol/laravel-auth-timeout/tree/v2).

Why Laravel Auth Timeout?
-------------------------

[](#why-laravel-auth-timeout)

There are times where we want to log out a user when they haven't done any request within a set time. There is a workaround (below):

```
/* Somewhere in config/session.php */
'lifetime' => 15,

```

But this affects the entirety of the session. But it doesnt have to be and that is where Laravel Auth Timeout comes in.

Laravel Auth Timeout is a small middleware package that checks if the user had made any request in a set of time. If they have reached the idle time limit, they are then logged out on their next request. Thanks to Brian Matovu's [article](http://bmatovu.com/laravel-session-timeout-auto-logout/).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require juliomotol/laravel-auth-timeout
```

You can publish the config file with:

```
php artisan vendor:publish --tag="auth-timeout-config"
```

This is the contents of the published config file:

```
