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 |
What is eloquent model?
How to enable maintenance mode in laravel 5?
What do you know about service providers in laravel?
Do you know what is http middleware?
Is laravel a cms?
What is the use of laravel framework?
How we can get user's detail when he is logged in using auth?
What is schema in laravel?
What are the benefits of laravel?
What is view laravel?
What is Laravel - File Uploading ?
What is dd () in laravel?