In this video we are going to learn about Http Session in Laravel.
All HTTP driven applications are stateless.
Sessions provide a way to store information about the user across multiple requests.
Laravel provides various drivers like file, cookie,array, Redis, and database to handle session data.
By default, file driver is used because it is lightweight.
Session can be configured using its configuration file.
So lets see the session configuration file.
Go to the project and open config folder.
Inside the config directory you can see the session.php file.
Just open this.
Here you can session related configuration.
Let see how can we use session in laravel 8.
For that, Lets Create a controller.
So switch to the command prompt and run the following command.

php artisan make:controller SessionController

Now lets open the SessionController file and here create a function.

public function getSessionData(Request $request)
echo $request->session()->get('name');
echo 'No data in the session';

Now create another method for Storing Session Data.

public function storeSessionData(Request $request) {
echo \"Data has been added to session\";

Now create another method for deleting session data.

public function deleteSessionData(Request $request) {
echo \"Data has been removed from session.\";

Ok now create the routes for these methods.
So just go to the web.php and create routes.


Now lets check so goto the browser and here for set the session.
So go to the url
Ok now you can see the message.
Session created Now get the session data go to the url.
and you can see the store session data which is name jenifer.
and in last just remove the session data so type.

So in this way you can use Http Session in Laravel 8.