// Save Session
$router->get('/', function (IlluminateHttpRequest $request) {
$request->session()->put('name', 'Lumen-Session');
return response()->json([
'session.name' => $request->session()->get('name')
]);
});
// Test session
$router->get('/session', function (IlluminateHttpRequest $request) {
return response()->json([
'session.name' => $request->session()->get('name'),
]);
});