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 are service providers in laravel?
What is use of laravel?
Which is better django or laravel?
How to create view Laravel - File Uploading ?
Differentiate between delete() and softdeletes().
Explain fluent query builder in laravel.
How to start laravel local development server.
How can you make real time sitemap.xml file in laravel?
What are the steps to configure homestead?
Explain how to generate pretty urls in laravel?
Explain how to configure cron jobs in homestead?
Do you know about laravel project?