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 is open source software?
What is the laravel framework?
Define lumen.
What service provider’s register method does?
How to use traits in laravel?
Can I use react with laravel?
what is meant by Laravel - Contracts ?
What is the use of blade?
What is a caas?
What is laravel spark?
What is blade laravel?
Laravle supports which databases?
Explain traits in laravel.
What are middleware groups?
What is bearer token?