Cookie session driver won't save any validation error or flash data

后端 未结 2 976
抹茶落季
抹茶落季 2021-02-07 02:42

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:

2条回答
  •  佛祖请我去吃肉
    2021-02-07 02:50

    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,
        ],
    
    ],
    

提交回复
热议问题