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
How do I disable csrf protection in laravel?
What is routing and how, and what are the different ways to write it?
Name the first file that loaded in laravel?
Is any server permissions required for laravel?
Explain important directories used in a common laravel application.
What is facades in laravel?
What is csrf protection in laravel?
Please explain the difference between laravel and codeigniter?
Explain Laravel - Event Handling ?
How to check if value is sent in request?
What do you mean by binding in laravel?
How do I seed my database for column that is a foreign key referencing to other table?
Write code to upload a file in laravel 5?
What is csrf_field () in laravel?
what is Blade ?