In this article, I will show you how to increase the session timeout in Laravel.
NOTE: Laravel session timeouts are set in minutes
We will be covering the following topics
Increase the session timeout for 1 year.
.env
SettingsSESSION_LIFETIME=525600
365 days * 24 hours * 60 minutes = 525600 minutes
You can even directly edit lifetime
in the session config settings as shown below.
As you see by default it will read from the .env
file. If you by chance delete the SESSION_LIFETIME
in .env
file then it will add 43200 minutes.
<?php
use Illuminate\Support\Str;
return [
.......
'lifetime' => env('SESSION_LIFETIME', 43200),
.......
];
Hope you got to know how to increase the session timeout in Laravel. Don't forget to share with your friends.
Firebase Cloud Messaging (FCM) Browser Web Push Notifications Using Javascript And PHP
Sass or SCSS @mixin vs @extends vs Placeholder (%)
Why You Should Run Cronjobs In Laravel?
Create Zip File On The Fly With Streaming Download In PHP Laravel
SummerNote WYSIWYG Text Editor
Test Your Local Developing Laravel Web Application From Phone Browser Without Any Software
Laravel Custom Maintenance Page
Website Speed and Performance Optimizations
Run Raw Queries Securely In Laravel
Push Files To CPanel / Remote Server using FTP Software FileZilla
Laravel Clear Cache Of Route, View, Config Command
Client-Side DataTable, Adding Super Powers To HTML Table
Send SMS With Amazon SNS (Simple Notification Service) Using PHP
PHP Built-In Web Server & Testing Your Development Project In Mobile Without Any Software