How to get Retrieving a Cookie in Laravel ?
Answer / rajani
Once we set the cookie, we can retrieve the cookie by cookie() method.
This cookie() method will take only one argument which will be the name of the cookie.
The cookie method can be called by using the instance of IlluminateHttpRequest.
Here is a sample code with explanation.
//’name’ is the name of the cookie to retrieve the value of
$value = $request->cookie('name');
Is This Answer Correct ? | 0 Yes | 0 No |
Does laravel prevent sql injection?
How to get current route name?
How to clear complete cache in laravel?
How to enable maintenance mode in laravel 5?
Explain the controllers in laravel?
Explain what is mvc architecture?
What are service providers?
How to register a middleware in laravel 5?
What is meant by Attaching Cookies ?
How to make a custom validation rule in laravel?
What is meant by Laravel - Localization ?
What does csrf token in laravel 5?