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 |
In which folder robot.txt is placed?
Explain how can you write your own service provider in laravel?
How will you check table is exists or in the database?
What are the difference between laravel 5 & laravel 4?
How to set login page as default page in laravel?
What is laravel illuminate?
Is laravel secure?
How do you define middleware?
What are the plateforms laravel homestead supports?
Is laravel easy?
What are the steps Redirecting to Named Routes in Laravel ?
What is service provider in laravel?