What is meant by Attaching Cookies ?



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

Post New Answer

More Laravel PHP Framework Interview Questions

Explain about Form without CSRF token in Laravel ?

0 Answers  


What is php artisan in laravel?

0 Answers  


What is the default session timeout duration?

0 Answers  


How will you describe fillable attribute in a laravel model?

0 Answers  


Do you know what is the latest version of laravel?

0 Answers  






Explain the concept of encryption and decryption in laravel.

0 Answers  


Is laravel a good framework?

0 Answers  


Explain the bindings and singletons properties?

0 Answers  


What is the difference between forget() and the pull() method ?

0 Answers  


Is react a library or a framework?

0 Answers  


Explain what are laravel facades?

0 Answers  


What is ajax in laravel?

1 Answers  


Categories