How to Deleting Session Data in Laravel ?
Answers were Sorted based on User's Feedback
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 |
Answer / Amod Kumar Singh
To delete session data in Laravel, you can use the `session()` helper function and the `forget()` method. For example, `Session::forget('key');` will remove the data associated with the specified key.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is laravel 5 homestead?
What is php artisan serve in laravel?
What is tinker in laravel?
What is mvc framework?
What is console in laravel?
Explain web.php route.
How install react js in laravel?
List types of relationships available in laravel eloquent?
Please explain the difference between laravel and codeigniter?
What is official website url of laravel?
Explain extending bindings?
What is the best package to set up billing and subscription with stripe and braintree?