Answer Posted / 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 View All Answers
How to get requested path in laravel?
Tell me when laravel was launched?
Explain dependency injection and their types.
List types of relationships available in laravel eloquent?
What is oauth2 in laravel?
How would you add a 3rd party package like sentry?
How can we use middleware in laravel?
What is the difference between namespace and use in laravel?
Tell me what is database migration? And how to use it to add insert initial data to database?
What is laravel orm?
How do I assign several roles to users and permit the users to perform some actions based on those roles?
What is Laravel - File Uploading ?
List types of the relationships supported by laravel?
List out common artisan commands used in laravel.
Explain how to create custom middleware in laravel?