Oct 2, 2017
0
Level 1
How to provide session persistence, when pushing data with push method?
Hi! I have a form and it send requests to the Laravel. Laravel controller catch requests and store data in session by push method, for example
$basename = pathinfo($path, PATHINFO_BASENAME);
if (!$request->session()->exists('upload')) {
$request->session()->put('upload', []);
}
$request->session()->push('upload', $basename);
var_dump($request->session()->get('upload'));
When form sends two requests to Laravel, I expects to see in var_dump two values in array, but I see only one value. Why it can happening? Thanks in advance!
Please or to participate in this conversation.