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

Why do we use hooks?

511


What are getters and setters php?

552


what is the scope of php in the future if any other language is developed then may be php is loss ???

13902


How to read and display a HTML source from the website url?

564


How to check an key is exists in array?

560






What are default session time and path?

569


Steps for the payment gateway processing?

561


How can I display text with a php script?

492


What is the difference between single quoted string and double quoted string?

533


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

538


Where are the persistent cookies stored on your computer?

583


What is php resource type?

534


How does php serialize work?

524


What is the use of "echo" in php?

539


What is a PHP Filter?

618