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 is the purpose of constant() function?

513


What is php default argument?

537


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

540


What are sql injections, how do you prevent them and what are the best practices?

498


How can you increase the maximum execution time of a script in php?

517






Do you know how to declare an array in php?

540


How do I escape data before storing it into the database?

528


What is the difference between rest and soap?

565


Explain how to execute a php script using command line.

556


What language is php based on?

487


Is php deprecated?

527


Explain about PHP cookies?

614


What is a php certification?

493


What is empty php?

491


Php being an open source is there any support available to it?

546