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

Difference between Authentication and Authorization ?

1322


List basic concepts in laravel?

730


Explain how to serve sites on valet?

694


How do you generate urls?

814


State the difference between authentication and authorization.

738


How do I log an error?

695


Does laravel support caching?

676


What is a check method ?

1104


Tell me what are system requirement for laravel 5.0?

755


What is Encryption Process ?

1390


What is composer in laravel?

745


What is routing in laravel?

764


What is a service provider laravel?

768


Why we use csrf token in laravel?

702


How can we handle Error Handling in Laravel ?

1470