Yes you can store more then one variable, but you will be required to extract the variables when accessing the cookie.
Example (Setting 1 cookie with 3 variables):
$info="field1,field2,field3";
setCookie("myfields",$info,time()+86400,".yourdoma in.com");
When we call the cookie
echo $_COOKIE[myfields]
It will print "field1,field2,field3"
So now we have to seperate the values. I will use explode for this.
$new_info=explode(",",$_COOKIE[myfields]);
foreach($new_info AS $new_field){
echo $new_field."<BR>";
}
You can also access it in an array.
echo $new_info[0];
echo $new_info[1];
echo $new_info[2];

__________________
CYTech-services.com - 100 Satisfied Customers - Custom Programming and Web Development
|