Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

session() in lumen

// 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'),
    ]);
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #lumen
ADD COMMENT
Topic
Name
3+8 =