How to add a cookie?

Answers were Sorted based on User's Feedback



How to add a cookie?..

Answer / 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

How to add a cookie?..

Answer / lamp

How to add a cookie,means what exactly...plz explain

Is This Answer Correct ?    1 Yes 7 No

Post New Answer

More PHP Interview Questions

How can we register the variables into a Session?

7 Answers   HCL, Star Computers, Trikon Networks,


What are arguments in php?

0 Answers  


How to remove blank spaces from the string?

0 Answers  


How big is varchar max?

0 Answers  


How to create reusable code in php?

0 Answers  


How can we make a constant in php?

0 Answers  


What is mysqli_real_escape_string?

0 Answers  


What are the difference between overloading and overriding in oops?

0 Answers  


What are php keywords?

0 Answers  


how can attached a file to a mail and attached a resume to a mail and received in id

0 Answers  


When do you use define() and when do you use const. What are the main differences between those two?

0 Answers  


What is the interface in php?

0 Answers  


Categories