Hello Devs,

In this tutorial, we are going to learn how to increase session timeout in laravel 7. 

Given below are few example for increasing session timeout in laravel 7. 




Example 1 : 


.env File

SESSION_LIFETIME=525600

config/session.php

<?php
  
use Illuminate\Support\Str;
  
return [
  
    .....
  
    'lifetime' => env('SESSION_LIFETIME', 120),
  
    .....
  
] 



Example 2: 


Using Config File config/session.php

<?php
  
use Illuminate\Support\Str;
  
return [
  
    .....
  
    'lifetime' => 1 * (60 * 24 * 365),
  
    .....
  
]


I hope this example helps you.