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
Explain the concept of events in laravel.
What is uuid in laravel?
What is the directory structure of laravel 5.6?
I just installed laravel and have the evil whoops error,how do I find out what’s wrong and fix it?
Please provide steps to configure homestead?
How to generate application key in laravel? Why it is neccessary?
How to enable maintaince mode in laravel?
Why use route?
Is laravel better than wordpress?
What is vagrantfile?
What is laravel model?
Is any server permissions required for laravel?
What are the benefits of facades?
How to use select query in laravel?
How do I register a middleware?