How to get Retrieving a Cookie in Laravel ?



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

Post New Answer

More Laravel PHP Framework Interview Questions

How to create Creating a Controller ?

1 Answers  


How do laravel facades work?

0 Answers  


What is the render method?

0 Answers  


How to disable maintaince mode in laravel?

0 Answers  


What is meant by Implicit Controllers

1 Answers  






How to make a helper file in laravel?

0 Answers  


are you able to laravel create-project via composer, explain how?

0 Answers  


What are bundles, reverse routing and the ioc container?

0 Answers  


How to return a view from route in laravel?

0 Answers  


What are laravel eloquent?

0 Answers  


Describe laravel service provider?

0 Answers  


Tell me how to use insert statement in laravel?

0 Answers  


Categories