It is hard to tell without seeing it in context but I do know that if you are using the file driver, you should be able to do what you are doing if your flash is for the very next request. Otherwise, you need to store it differently. Are you using barryvdh debugger? If so, check your session value there. If its there, then maybe use a different way to access it.
Laravel 5.3 Session Flash Not Working
I have a laravel 5.1 application that I've been porting to 5.3. I started with a brand new installation of 5.3 and moved classes, controllers, views, etc over and tested as I moved. Everything works now except I cannot get session()->flash('success', 'This works!'); to work like they did before. I've spun up a new 5.3 app and the following works there, but returns null in the migrated application.
Route::get('start', function(){
session()->flash('success', 'This was successful');
return redirect('/end');
});
Route::get('end', function(){
dd(session('success'));
});
I've verified that the session.php config file has the same values, minus the cookie name being different. Sessions are being stored everytime I visit the test site and explicit keyed sessions work, like session(['success', 'This was successful']);
Does anyone have any idea what might be causing this problem?
So, it must be middleware or controller problem? Something is not quite right in something you brought over. I am getting ready to migrate a 5.1 app to 5.3 or 5.4 soon so I am interested in your issues.
Please or to participate in this conversation.