Laravel sessions regenerating on every load

后端 未结 8 2245
盖世英雄少女心
盖世英雄少女心 2021-02-18 19:05

I\'m having a lot of problems and I really can\'t seem to find a solution.

Yesterday, I finished up doing some work on a vagrant box in Laravel. When I shut down the com

8条回答
  •  执念已碎
    2021-02-18 19:27

    I upgraded from Laravel 5.1 to 5.2 and had the issue of numerous sessions being created on every page load. It didn't matter which session driver I used, nor did changing anything in config make it work. (I tried every suggestion on every StackOverflow result produced by Google.)

    The solution for me: remove "web" middleware from your routes. Apparently, web middleware is included automatically in 5.2+, so if your routes ALSO specify it, you wind up with multiple sessions being generated.

提交回复
热议问题