Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to Deleting Session Data in Laravel ?

Answer Posted / amit khanna

The forget() method is used to delete an item from the session.
This method will take key as the argument.

Syntax : $request->session()->forget('key');

Use flush() method instead of forget() method to delete all session data.
Use the pull() method to retrieve data from session and delete it afterwards.
The pull() method will also take key as the argument.
The difference between the forget() and the pull() method is that forget() method will not return the value of the session and pull() method will return it and delete that value from session.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the databases laravel supports?

721


What is http / console kernels in laravel?

730


What is pluck method in laravel?

735


What are route parameters?

717


What is gate in laravel?

688


What do you know about csrf token in laravel?

718


What do you understand by unit testing?

719


What is route parameters in laravel?

731


How to launch vagrant box?

656


Explain php artisan?

633


What is meant by Controller Middleware ?

1783


Please explain events in laravel?

670


Can we assign multiple middlewares to a route.

680


What is database seeding in laravel?

718


What is namespace laravel?

700