What is meant by Attaching Cookies ?
Answer / 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 |
How to distroy cookies in laravel?
What are route parameters?
Explain facades in laravel?
How to use ajax in any form submission?
How to install and start, stop mysql on valet?
What is the difference between contracts vs facades?
What is the difference between {{ $username }} and {!! $Username !!} In laravel?
Explain what is mvc architecture?
What is laravel forge?
How to install homestead vagrant box?
What is ioc container in laravel?
How to create view Laravel - File Uploading ?