What is the best way to set two or more vvalues in one cookie? Cookies can only contain one value, but sometimes you want to have one cookie contain more than one setting.
I suppose it would go like this in someway. 1) check the cookie, 2) parse its value, 3) separate the two or more values you want to look for from the string the cookie contains, 4) put those into variables.
If this is correct, I am not sure about the best way of doing (2) and (3). Any suggestions are welcome.
You would first have to separate each value in the cookie with a unique character or string (like #, #@ etc) and then split them, using explode(), after reading the cookie
I also found another function, parse_str. Which uses a pre-defined syntax for parsing strings (and cookies) and auto-fills variables.
It seems a little like a security risk though since one could alter the cookie and then design their own variables - some of which might interfere with your programming.