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 create Creating a Controller ?
How do laravel facades work?
What is the render method?
How to disable maintaince mode in laravel?
What is meant by Implicit Controllers
How to make a helper file in laravel?
are you able to laravel create-project via composer, explain how?
What are bundles, reverse routing and the ioc container?
How to return a view from route in laravel?
What are laravel eloquent?
Describe laravel service provider?
Tell me how to use insert statement in laravel?