How to add a cookie?
Answers were Sorted based on User's Feedback
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 |
Answer / lamp
How to add a cookie,means what exactly...plz explain
| Is This Answer Correct ? | 1 Yes | 7 No |
what use of <?php
How to get the total number of values in an array?
What is the difference between public, protected and private?
Is php 5.6 secure?
How can we get second of the current time using date function?
How to add comments in php?
How can we destroy the cookie?
How come the code works, but doesn’t for two-dimensional array of mine?
How to enable cURL in PHP?
Is key exist in array php?
What types of images that PHP supports?
In PHP, fgets() is used to read a file one line at a time. State Whether True or False?