A
A
Alexander Sharomet2017-06-19 11:51:10
Laravel
Alexander Sharomet, 2017-06-19 11:51:10

Why doesn't the session persist in Laravel 5.4?

Hello.
I have this problem:
session is not saved

Session::put('test', 'Test Session');
var_dump(Session::get('test')); // Сессию видно

But as soon as I comment out the
//Session::put('test', 'Test Session');
session disappears.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Aksentiev, 2017-06-19
@sharomet

why is the call static?
It is not tied anywhere and it lives until the end of the work once.
https://laravel.com/docs/5.4/session#using-the-session
or is storage not configured?

K
Kirill Nesmeyanov, 2017-06-20
@SerafimArts

1) Is the middleware for starting sessions for the web environment registered?
2) Is stateful session storage being used? Or statesles like array?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question