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 service providers?
Is laravel object oriented?
How to get current url in laravel?
How to configure route cache in laravel?
Explain the controllers in laravel?
What is namespace in php laravel?
What is csrf protection in laravel?
Explain what is laravel
What do you mean by bundles?
What is the default session timeout duration and how can it be set?
What is csrf protection?
How long have you been using laravel?
What is difference between single quote and double quote?
What are the Severity Levels in Laravel ?
Can you explain about serialization?