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
What is laravel api rate limit?
How to turn off crsf protection for specific route in laravel?
How to work with an Error in Laravel ?
What is meant by Implicit Controllers
What is php artisan.
Why we use csrf token in laravel?
When laravel was launched?
I just installed laravel and have the evil whoops error,how do I find out what’s wrong and fix it?
What is csrf_field () in laravel?
What is an observer?
What is the default session timeout duration?
What is x-csrf-token , how it is different from csrf tokens?
How do I set up the eloquent relationships between the aforementioned comments and authors, including creating the schema design?
Is laravel better than wordpress?
what is meant by CSRF Protection in Laravel ?