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

What is eloquent orm?

0 Answers  


Why laravel over other php frameworks?

0 Answers  


Tell me how to enable the query logging?

0 Answers  


Explain how to share your homestead with others?

0 Answers  


What is csrf protection token?

0 Answers  






List the default ports that are forwarded to your homestead environment?

0 Answers  


How to assign a variable value for all view file?

0 Answers  


Tell me what are the feature of laravel 5.0?

0 Answers  


How do I send 5 emails and a text message efficiently to newly registered users?

0 Answers  


What is reverse path multicasting?

0 Answers  


How will you describe bundles in laravel?

0 Answers  


What are laravel facades?

0 Answers  


Categories