📜  创建会话以存储和检索数据 - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:51.505000             🧑  作者: Mango

代码示例1
Route::get('/home', function () {
    // Retrieve a piece of data from the session...
    $value = session('key');

    // Specifying a default value...
    $value = session('key', 'default');

    // Store a piece of data in the session...
    session(['key' => 'value']);
});