How To Increase Session Lifetime In Laravel

  • We can not set lifetime session for permanently but we can set in minutes for session expiration time. so here we will set 1 year time for session expire.
60 * 24 * 365 = 525600 // 1 year 
  • Here I will give you 2 solution for increase session timeout in laravel.
SESSION_LIFETIME=525600
<?php

use Illuminate\Support\Str;

return [
‘lifetime’ => env(‘SESSION_LIFETIME’, 120),

]
<?php

use Illuminate\Support\Str;

return [

‘lifetime’ => 1 * (60 * 24 * 365),

]

--

--

--

I am Laravel and PHP Developer. I have also Good Knowledge of JavaScript, jQuery, Bootstrap and REST API.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The top critical highlights of IoT platform

On (Programming) Language Design

Loki Setup for Kubernetes cluster

Sending Emails through Rails Apps

Fluttering over mobile app deployment tools

Software visualization: A short and simple introduction

Javascript Integration with Docker and Machine Learning

Amazon Kinesis Data Monitoring with Xeotek KaDeck

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Websolutionstuff

Websolutionstuff

I am Laravel and PHP Developer. I have also Good Knowledge of JavaScript, jQuery, Bootstrap and REST API.

More from Medium

Laravel 8 v 9 — Eloquent Mutators & Casting

Why Laravel Is the Best PHP Framework — 10 Reasons to go with it!

Step by step guide on Mailchimp integration in laravel

Integrate PHP application with Firebase