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 |
How to check request is ajax or not?
What are pros and cons of using laravel framework?
What is binding in laravel?
What is luman?
Tell me when laravel was launched?
What do you understand by database migrations in laravel? How can we use it?
What is a Middleware Parameters ?
Explain how to redirect user with flashed session data in laravel?
What is laravel elixir?
Explain how to localize resource uris in laravel?
what is meant by Listeners ?
What are the difference between laravel 5 & laravel 4?