{"id":36993434,"url":"https://github.com/devsrv/laravel-session-out","last_synced_at":"2026-01-13T23:45:37.536Z","repository":{"id":56967037,"uuid":"153936700","full_name":"devsrv/laravel-session-out","owner":"devsrv","description":"display message to users if their login session has expired","archived":true,"fork":false,"pushed_at":"2018-11-03T07:22:49.000Z","size":53,"stargazers_count":5,"open_issues_count":1,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-12T03:20:42.883Z","etag":null,"topics":["laravel","laravel-5-package","session-expiration"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/devsrv/laravel-session-out","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devsrv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-20T18:39:03.000Z","updated_at":"2025-05-21T20:29:33.000Z","dependencies_parsed_at":"2022-08-21T11:20:21.574Z","dependency_job_id":null,"html_url":"https://github.com/devsrv/laravel-session-out","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/devsrv/laravel-session-out","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsrv%2Flaravel-session-out","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsrv%2Flaravel-session-out/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsrv%2Flaravel-session-out/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsrv%2Flaravel-session-out/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devsrv","download_url":"https://codeload.github.com/devsrv/laravel-session-out/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devsrv%2Flaravel-session-out/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28405297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","laravel-5-package","session-expiration"],"created_at":"2026-01-13T23:45:37.470Z","updated_at":"2026-01-13T23:45:37.522Z","avatar_url":"https://github.com/devsrv.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Session expired message for your Laravel application\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/devsrv/laravel-session-out.svg?style=flat-square)](https://packagist.org/packages/devsrv/laravel-session-out)\n[![GitHub license](https://img.shields.io/github/license/devsrv/laravel-session-out.svg?style=flat-square)](https://github.com/devsrv/laravel-session-out/blob/master/LICENSE)\n[![Total Downloads](https://img.shields.io/packagist/dt/devsrv/laravel-session-out.svg?style=flat-square)](https://packagist.org/packages/devsrv/laravel-session-out)\n[![Laravel Support](https://img.shields.io/badge/Laravel-5.*-blue.svg?longCache=true\u0026style=flat-square)](#)\n[![GitHub issues](https://img.shields.io/github/issues/devsrv/laravel-session-out.svg?style=flat-square)](https://github.com/devsrv/laravel-session-out/issues)\n\n\nIf for any reason _**( user logged out intentionally / session lifetime expired / session flushed for all logged in devices of the user )**_ the authentication session doesn't exist \u0026 still the user is on a page or multiple pages which require the user to be logged in, then showing a message that\n\n\u003e authentication session no longer available \u0026 to continue your current activity _( may be in the middle of posting an unsaved post etc. )_, you are advised to login again\n\nand right after user logged in then hiding the message is all about this package.\n\n\n## 📥  Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require devsrv/laravel-session-out\n```\n\n\u003e Laravel 5.5+ users: this step may be skipped, as we can auto-register the package with the framework.\n\n```php\n\n// Add the ServiceProvider to the providers array in\n// config/app.php\n\n'providers' =\u003e [\n    '...',\n    'devsrv\\sessionout\\sessionExpiredServiceProvider::class',\n];\n```\n\nYou need to publish the `blade`, `js`, `css` and `config` files included in the package using the following artisan command:\n```bash\nphp artisan vendor:publish --provider=\"devsrv\\sessionout\\sessionExpiredServiceProvider\"\n```\n\n\n## ⚗️ Usage\n\njust include the blade file to all the blade views which are only available to authenticated users.\n\n```php\n@include('vendor.sessionout.notify')\n```\n\n\u003e rather copying this line over \u0026 over to the views, extend your base blade view and include it there in the bottom\n\n\n\n## 🛠  Configuration\n\n#### ✔ The Config File\n\npublishing the vendor will create `config/expiredsession.php` file\n\n```php\nreturn [\n\t// the number of seconds between ajax hits to check auth session\n    'gap_seconds' =\u003e 30,\n    \n    // whether using broadcasting feature to make the modal disappear faster\n    'avail_broadcasting' =\u003e false,\n```\n\n#### ✔ If you want to take advantage of broadcasting\n\n\u003e ** if you are using `avail_broadcasting = true` i.e. want to use the Laravel Echo for faster output please follow the below steps\n\n1. setup [broadcasting](https://laravel.com/docs/master/broadcasting) for your app\nand start `usersession` queue worker\n```bash\nphp artisan queue:work --queue=default,usersession\n```\n\n2. make sure to put the broadcasting client config `js` file above the `@include` line not below it, in your blade view.\n```php\n\u003cscript type=\"text/javascript\" src=\"{{ asset('js/broadcasting.js') }}\"\u003e\u003c/script\u003e\n//some html between\n@include('vendor.sessionout.notify')\n```\n3. in `App\\Providers\\BroadcastServiceProvider` file in the `boot` method require the package's channel file, it contains private channel authentication\n```php\nrequire base_path('vendor/devsrv/laravel-session-out/src/routes/channels.php');\n```\n4. in all the places from where users are authenticated call `devsrv\\sessionout\\classes\\AuthState::sessionAvailable()` .\nif you are using custom logic to login users then put the line inside your authentication method when login is successful. \n\u003e if you are using laravel's default authentication system then better choice will be to create a listener of the login event, Example :-\n```php\n// App\\Providers\\EventServiceProvider\n\nprotected $listen = [\n        'Illuminate\\Auth\\Events\\Login' =\u003e [\n            'App\\Listeners\\SuccessfulLogin',\n        ],\n    ];\n```\n```php\n// App\\Listeners\\SuccessfulLogin\n\nuse devsrv\\sessionout\\classes\\AuthState;\n\n/**\n* Handle the event.\n*\n* @param  Login  $event\n* @return void\n*/\npublic function handle(Login $user)\n{\n\tAuthState::sessionAvailable();\n}\n```\n\n\n#### ✔ Update the modal design \u0026 contents\n\nThe modal is created with pure `js` and `css` no framework has been used, so you can easily customize the modal contents by editing the `views/vendor/sessionout/modal.blade.php` \u0026 the design by editing `public/vendor/sessionout/css/session-modal.css`\n\n#### ✔ Advanced\n\n- 🔘 if you want to customize the `js` file which is responsible for checking auth session \u0026 modal display then modify the `public/vendor/sessionout/js/main.js` file but don't forget to compile it with webpack \u0026 place the compiled `js` as `public/vendor/sessionout/dist/js/main.js`\n\n- 🔘 **you may want to create a login form** in the modal, first create the html form in the `views/vendor/sessionout/modal.blade.php` then put the ajax code in `public/vendor/sessionout/js/main.js` \u0026 don't forget to compile as mentioned above,\n\u003e after ajax success close the modal by calling the `closeSessionOutModal()` function\n\n\n## 🧐📑 Note\n\n#### ♻ When updating the package\n\nRemember to publish the `assets`, `views` and `config` after each update\n\nuse `--force` tag after updating the package to publish the **updated latest** package `assets`, `views` and `config` \n\u003e but remember using _--force_ tag will replace all the publishable files\n\n```bash\nphp artisan vendor:publish --provider=\"devsrv\\sessionout\\sessionExpiredServiceProvider\" --force\n\nphp artisan vendor:publish --provider=\"devsrv\\sessionout\\sessionExpiredServiceProvider\" --tag=public --force\n```\n\n\u003e when updating the package take backup of the `config/expiredsession.php` file \u0026 `public/vendor/sessionout`, `views/vendor/sessionout` directories as the files inside these dir. are configurable so if you modify the files then the updated published files will not contain the changes, though after publishing the `assets`, `views` and `config` you may again modify the files\n\n#### 🔧 After you tweak things\n\nRun this artisan command after changing the config file.\n```bash\nphp artisan config:clear\nphp artisan queue:restart // only when using broadcasting\n```\n\n## 👋🏼 Say Hi! \nLet me know in [Twitter](https://twitter.com/srvrksh) | [Facebook](https://www.facebook.com/srvrksh) if you find this package useful 👍🏼\n\n\n## 🎀 License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevsrv%2Flaravel-session-out","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevsrv%2Flaravel-session-out","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevsrv%2Flaravel-session-out/lists"}