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 do you end a function in python?

0 Answers  


Which is used to maintain the value of a variable over different pages?

0 Answers  


Do you know is it possible to extend the execution time of a php script?

0 Answers  


Is php closing tag necessary?

0 Answers  


Is it easy to learn php?

0 Answers  






hello experts good morning to everyone ! at present am now learning LAMP course sir( linux, apache,mysql and php) after finishing this course can i create my own website without investment is it possible ? please can any one tell sir and also tell me how can i upload my project after finishing the project in internet ? please tell the ways sir please send ur valuable suggestions to kiranpulsar2007@gmail.com

2 Answers  


Declare a new variable in php equal to the number 3;

0 Answers  


What is the use of friend function?

7 Answers   Wipro,


Is python similar to php?

0 Answers  


Which array function checks if the particular key exists in the array?

0 Answers  


What’s the difference between md5(), crc32() and sha1() crypto on PHP? -

2 Answers  


How would you determine the size of a file in php?

0 Answers  


Categories