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 observer in laravel?
What is system requirement for installation of laravel 5.2 (latest version)?
What is service providers in laravel?
What is route model binding in laravel?
List the software’s included in laravel homestead?
what is Basic Routing ?
Explain me how to assign multiple middleware to laravel route ?
Explain validation concept in laravel.
what are the benefits of laravel over other php frameworks? Explain
What is eloquent orm in laravel?
What is backend framework?
What is a service provider laravel?