Laravel: Session expires while registration form is open

后端 未结 3 1166
北恋
北恋 2021-01-26 07:47

I have have a web app which is waiting for users on a laptop in kiosk mode. Sometimes, registration fails and users get an error screen - I think it\'s 419 Session Expired.

3条回答
  •  暖寄归人
    2021-01-26 08:10

    You note yourself that you can change the session time in config/session.php. Is there a reason why you don't want to change that?

    Alternatively, assuming that this is not an app that is accessible on the World Wide Web and is for Kiosk use only, you can exclude certain routes from requiring the CSRF token altogether;

    Edit the **$except** property of the VerifyCsrfToken middleware;

    protected $except = [
        'stripe/*',
        'http://example.com/foo/bar',
        'http://example.com/foo/*',
    ];
    

    Information taken from the Laravel Documentation.

提交回复
热议问题