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 |
What is meant by Error Log ?
Do you know what is luman?
What is Laravel - File Uploading ?
How do I assign several roles to users and permit the users to perform some actions based on those roles?
How to start mysql on valet?
What are class traits?
What is controller middleware in laravel?
What is a Composer command ?
Does laravel prevent sql injection?
How can we configure a mail-in laravel?
Explain the concept of events in laravel.
What is localization?