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...

How to add a cookie?

Answer Posted / rupali

bool setcookie ( string $name [, string $value [, int
$expire [, string $path [, string $domain [, bool $secure
[, bool $httponly ]]]]]] )
for e.g.
<?php
$value = 'something from somewhere';

setcookie("TestCookie", $value);
setcookie("TestCookie", $value, time()+3600); /* expire in
1 hour */
setcookie("TestCookie", $value, time()
+3600, "/~rasmus/", ".example.com", 1);
?>

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to set session.gc_maxlifetime properly?

1116


How do you sort an array in php?

1019


What is a lambda function in php?

1168


Differentiate between require and include?

1021


Tell me how is it possible to propagate a session id?

1091


Is laravel an oop?

962


Is php outdated 2019?

994


How to send a cookie to the browser?

1069


How to convert a string to uppercase in php?

1137


Tell me how can I display text with a php script?

1021


What is the different between count() and sizeof() in php?

988


What is session in PHP. How to remove data from a session?

1038


What does the scope of variables mean?

1005


What are the ways to include file in php?

1045


Describe the security vulnerability of PHP?

1087