Answer Posted / sunil kumar
The withcookie() helper method is used to attach cookies.
The cookie generated with this method can be attached by calling withcookie() method with response instance.
By default, all cookies generated by Laravel are encrypted and signed so that they can't be modified or read by the client.
Example :
Route::get('/cookie',function(){
return response("Hello", 200)->header('Content-Type', 'text/html')
->withcookie('name','Virat Gandhi');
});
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What do you know about closures in laravel?
What is use of laravel?
What is database migration. How to create migration via artisan?
How to enable maintenance mode in laravel 5?
What are route parameters?
What is mvc laravel?
Tell me how can you display html with blade in laravel?
Explain me how to assign multiple middleware to laravel route ?
What is database migration in laravel? How to use this?
How to check if value is sent in request?
What is laravel language?
What is laravel illuminate?
What is meant by Laravel - Localization ?
State the difference between authentication and authorization.
What is laravel homestead?