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 |
How to use multiple or condition in laravel query?
Can you update homestead? If yes, how?
What is x-xsrf-token?
What is a facade?
Do you know laravel service container?
Tell me how to get current environment in laravel 5?
How to assign a variable value for all view file?
Explain collections in laravel.
What do you mean by laravel mix?
How can we turn off csrf protection for a particular route?
How secure is laravel?
How do I seed my database for column that is a foreign key referencing to other table?