I created a cookie with the value like '1A2A',now i want to
update this value regularly (about 20 times in a minute)
with the value '1A2A3A' , 3A is the new value,new value
will vary on the request it may be 3A or 4A or 100A ,some
times the cookie is updating with new value but not every
time.Can any body suggest the solution



I created a cookie with the value like '1A2A',now i want to update this value regularly ..

Answer / amit verma

use PHH function "setcookie", the only point to note is,
the name of the cookie needs to be same, for differetn
values of this cookie. This way it will keep overwritting
different values for single cookie. Syntax is -

setcookie("TestCookie", $value1);
setcookie("TestCookie", $value2);
setcookie("TestCookie", $value3);
..
.. and so on

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More PHP Interview Questions

What is php call function?

0 Answers  


What is difference between html and php?

0 Answers  


Tell me what is the difference between ereg_replace() and eregi_replace()?

0 Answers  


Which is incorrect with respect to separating php code and html?

0 Answers  


How to make a class in php?

0 Answers  






What is the difference between session_unregister() and session_unset()?

0 Answers  


How to convert strings to upper or lower cases?

0 Answers  


What are psrs? Choose 1 and briefly describe it?

0 Answers  


How failures in execution are handled with include() and require() functions?

0 Answers  


Explain about Functions in PHP?

1 Answers  


How we load all classes that placed in different directory in one php file , means how to do auto load classes.

0 Answers  


What is the Default syntax used in PHP?

0 Answers  


Categories