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 meant by Authorization Mechanism in Laravel ?
Is any server permissions required for laravel?
What are the operations perfom while Connecting the Database ?
Explain Constructor Injection ?
What are the software’s included in laravel homestead?
What is antiforgerytoken used for?
What is method spoofing?
what are Important Points contracts in Laravel ?
What are the feature of laravel 5.0?
What is eloquent model?
How to check table is exists or not in our database using laravel?
Explain binding instances?
What is meant by Modularity ?
What is ssrf attack?
Difference between Authentication and Authorization ?