session variable in laravel
ReportQuestion
2 years ago 735 views
Sessions are used to store information about the user across the requests. Laravel provides various drivers like file, cookie, apc, array, Memcached, Redis, and database to handle session data. By default, file driver is used because it is lightweight. Session can be configured in the file stored at config/session.php.
Accessing Session Data
$value = $request->session()->get('key');
Storing Session Data
$request->session()->put('key', 'value');
Deleting Session Data
$request->session()->forget('key');
Thread Reply