Sessions are used to store information about the user temporarily across the requests. The session configuration file is stored in config/session.php, from this file you can change the session driver, session lifetime, and more. For example, if you want to encrypt all your session data you can configure it easily from the config/session.php file.

By default, laravel is configured to use the file session driver which is store your sessions files in storage/framework/sessions.

You can store the session with a request instance or from the request() helper method which returns the current request instance : $request->session()->put('key' , 'value'); You can also retrieve session data : $value = $request->session()->get('key'); #retrieving-amp-deleting-an-item Retrieving & Deleting An Item
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners