Its a laravel 5.2 app. I have these 2 functions:
public function page1()
{
Session::put('test', '1');
$value = Session::get('test');
echo 'test: '.$value;
}
public function page2()
{
$value = Session::get('test');
echo 'test: '.$value;
}
I first go to localhost/page1. And I can see that the page prints:
test: 1
I then go to localhost/page2
But the page prints:
test:
So it seems like the sessions are not shared among views. Why? Is this some config issue?
This is route.php:
Route::group(['prefix' => 'pages'], function()
{
Route::get('page1', 'AdminController@page1');
Route::get('page2', 'AdminController@page2');
});
routes.phpfile please.