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 |
Explain few features of laravel?
In which folder robot.txt is placed?
What do you mean by binding in laravel?
Explain collections in laravel.
What is guarded attribute in a model?
What is rate limiting?
What is luman?
What is meant by CRUD and explain each of it Operations ?
What are the Versions Laravel - Understanding Release Process ?
What is the difference between laravel and symfony?
What are view composers?
How to retrive current environment in laravel?