B
B
Bikeformer2016-10-08 13:11:53
Laravel
Bikeformer, 2016-10-08 13:11:53

Session is not working correctly?

Laravel 5.2.45
I can't figure out why laravel doesn't remember my sessions.
I write this code:

Session::put('key', 'value');
dd(Session::all());

I get an array where the system information (token, etc.) and what I added, key => value.
I comment Session::put('key', 'value'), I refresh the page and what I added disappears, but the system information remains the same as it was.
What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor, 2016-10-08
@Bikeformer

Is the route added to the web group?
Only in it session is started.
Also, you can't use dd, because it completes the processing of the request without running the handler that writes data to the session.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question