I am having a hard time with the cookie session driver in Laravel.
I have a simple form with a validation in place. This is my method for saving this form data:
The browser has limitation of cookie. It's too large for the browser to store the cookie while you use cookie
as the session driver. You can check the browser cookie limitation here http://browsercookielimits.iain.guru/
Recommendation:
Use redis
as the session driver.
Steps:
1.After installed Redis server, add the predis/predis
package:
composer require predis/predis
2.Change your configuration file config/database.php
:
'redis' => [
'client' => 'predis',
'default' => [
'host' => env('REDIS_HOST', 'localhost'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],