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 Laravel - Encryption ?
How to use ajax in any form submission?
What is the default session timeout duration?
Explain request life cycle of laravel.
State the difference between codeigniter and laravel.
How to create custom library in laravel?
What is route in laravel?
How will you check table is exists or in the database?
How do I setup localization for an application?
What do you know about service providers in laravel?
What is an observer in laravel?
Is laravel faster than rails?