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 |
Why doesn't laravel use semantic versioning?
How to check if value is sent in request?
What is kernel in laravel?
What are the server requirements for laravel 6.0?
How to install mysql on valet?
Tell me how do you do dependency injection in laravel?
Can you exclude uris from csrf protection in laravel? Explain
Is laravel spark free?
What is dd () in laravel?
How to set cookies in laravel?
How to get data between two dates with query in laravel?
why we use Laravel - Session ?