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 |
What is mass assignable in laravel?
What is meant by Authorization Mechanism in Laravel ?
What is laravel trait?
How to configure a mail-in laravel?
How do I setup localization for an application?
What are the feature of laravel 5.0?
What is composer in laravel php?
What is dd () in laravel?
What is fillable attribute in a model?
What is automatic injection in laravel?
What is meant by Logging ?
How to remove /public from url in laravel?