Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is meant by Attaching Cookies ?

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


Please Help Members By Posting Answers For Below Questions

Explain the concept of events in laravel.

785


What is uuid in laravel?

722


What is the directory structure of laravel 5.6?

712


I just installed laravel and have the evil whoops error,how do I find out what’s wrong and fix it?

725


Please provide steps to configure homestead?

736


How to generate application key in laravel? Why it is neccessary?

771


How to enable maintaince mode in laravel?

714


Why use route?

716


Is laravel better than wordpress?

779


What is vagrantfile?

756


What is laravel model?

734


Is any server permissions required for laravel?

779


What are the benefits of facades?

747


How to use select query in laravel?

819


How do I register a middleware?

807