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 ?



How to Deleting Session Data in Laravel ?..

Answer / 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

More Laravel PHP Framework Interview Questions

How to register a middleware in laravel 5?

0 Answers  


How to stop valet?

0 Answers  


Explain collections in laravel.

0 Answers  


List some aggregates methods provided by query builder in laravel?

0 Answers  


Define contextual binding?

0 Answers  


What are route prefixes?

0 Answers  


How to remove /public from url in laravel?

0 Answers  


How to create Facade in Laravel ?

1 Answers  


Where do you locate database configuration file?

1 Answers  


What is the best package to set up billing and subscription with stripe and braintree?

0 Answers  


Is laravel a cms?

0 Answers  


What encryption does laravel use?

0 Answers  


Categories