Replies: 3 comments
-
You cannot call the session in the constructor like that. The reason being that your The controller gets constructed in \Illuminate\Routing\Route::gatherMiddleware as Laravel has a weird feature (that should IMO be removed) that allows you to add middleware in the controller constructor which leads to problems like this one (as the controller gets created before any of the route middleware gets executed). |
Beta Was this translation helpful? Give feedback.
-
@X-Coder264 Yes, maybe I not provided a good example. Even if I move sessions "setters" from |
Beta Was this translation helpful? Give feedback.
-
Hey, @driesvints I saw that you are close my issue and mark it like Q&A, but I am sure that this is a bug... I am not sure why this is happening but will take a deeper look soon and find what causes it. |
Beta Was this translation helpful? Give feedback.
-
Description:
I have an issue with session drivers "file" and "redis". My app is a simple e-store, but in order to work well with a third-party vendor, I must use several sessions in one checkout, for example 20+. My issue starts when using too many sessions.
Steps To Reproduce:
If you go to: https://laravelplayground.com/#/snippets/bdbd0f74-e871-4a9b-911c-88a4c8eca9cb and uncomment just one line in CheckoutService.php (From line 24 until line 44) session will start to fails.
Beta Was this translation helpful? Give feedback.
All reactions