Therefore, I never had to use cookies, but now I am creating a shopping basket that they can continue to return and leave, but I want it to keep what they added.
What interests me:
How to check if a cookie exists and then create or update it, is this the best way to think about using a cookie?
How exactly will I store the data, in particular, I want to save a list of identifiers like "5,6,7,8", should I just use one line for this, or is there a faster / better way than reading / parsing / writing something like that? I mean, I suppose that I will just add new_value + ',' to the end, is there an append for cookie variables?
Does the cookie have a unique identifier that I would use to make sure that I am not writing duplicates or anything else?
Note. It's easy to see โHOWโ, how to see the syntax, but I'm really trying to understand the โbest wayโ or the most ideal, how it should have been used, or like all you programmers have found the most fruitful way to use them in this type of script.
Bigomega
source share