且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Laravel会话始终会更改Laravel 5.4中的每个刷新/请求

更新时间:2023-02-05 12:36:15

我发现此问题的解决方案分为两部分,不知道为什么会有所不同,因为它是相同的操作系统和设置.

I found the solution to this was 2 parts, not sure why it varied since it was the same OS and setup.

第1步,请确保正确设置了COOKIE_DOMAIN且没有端口号(在.env中或直接在/config/session.php中,无论使用哪种方式)

Step 1 make sure that COOKIE_DOMAIN is set properly and with no port numbers (Either in .env or directly in /config/session.php, whichever you use)

第2步,请确保/config/sessions.php中的cookie名称('cookie'=>'whatever')中没有下划线. Laravel显然对此有疑问.

Step 2 make sure that the cookie name ( 'cookie' => 'whatever') inside of /config/sessions.php does NOT have an underscore in it. Laravel apparently has had issues with this.