How to set session or cookie timeout in Laravel Lumen
How to set Cookie / Session lifetime in Lumen. In laravel this can be found in app/config/session.php
, but since Lumen uses a .env
file for its configuration, how do I set the session lifetime? Also, when I put a value into a session, Session::put($key,$value)
it lasts no more than three requests, the value is lost, could this be due to its life time or something else?
just in case, here's my file .env
looks like this:
APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomKey!!!
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
DB_CONNECTION=mysql
DB_HOST=localhost
DB_DATABASE=test
DB_USERNAME=root
DB_PASSWORD=
CACHE_DRIVER=cookie
SESSION_DRIVER=cookie
QUEUE_DRIVER=database
source to share
You can install it with SESSION_LIFETIME=60
More session configuration options can be found here https://github.com/laravel/lumen-framework/blob/5.0/config/session.php
source to share