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

Explain the syntax for ‘foreach’ loop with example.

1005


Explain what are psrs?

1011


Where do we use get and post?

1028


What is session cookies php?

1040


What is dao in php?

1016


What are traits?

1366


What is env in laravel?

1076


What does sign mean php?

1033


What is the difference between null and empty?

1079


What does $_cookie means?

1035


What is htaccess in php?

1370


What changes I have to do in php.ini file for file uploading?

1120


What is the difference between single-quoted and double-quoted strings in php?

1180


How can we create a database using php?

1196


What is varchar mysql?

1262