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

Explain few features of laravel?

0 Answers  


In which folder robot.txt is placed?

0 Answers  


What do you mean by binding in laravel?

0 Answers  


Explain collections in laravel.

0 Answers  


What is guarded attribute in a model?

0 Answers  






What is rate limiting?

0 Answers  


What is luman?

0 Answers  


What is meant by CRUD and explain each of it Operations ?

0 Answers  


What are the Versions Laravel - Understanding Release Process ?

1 Answers  


What is the difference between laravel and symfony?

0 Answers  


What are view composers?

0 Answers  


How to retrive current environment in laravel?

0 Answers  


Categories