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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the functions for imap?

672


What is scope of variable in php?

665


What is cookie and session in php?

588


How can you compare objects in php?

592


What is the use of mvc in php?

614






What is csrf cookie?

559


What should be the length of variable for SHA256?

619


What is serialization in php?

546


Does mysql need php?

560


What websites use php?

609


Which php framework is best for beginners?

607


Where is session value stored php?

622


What is the default time of cookie in php?

609


Which is useful for method overloading?

701


Which function can be used to delete a file?

691