What is the difference between key and value in html cookies?
i saw that a cookie looks like this in html request:
not like this:
Cookie: name1=key1; name2=key2;
but rather like this:
Cookie: key1=value1; key2=value2;
and if a want to make a unique personal id for each cookie, say “UUID”,
should i write key=”UUID”? or value=”UUID”?
im sorry for the “silly” question but im really confused here…
thank you!
a key-value pair is a way of storing information in an easily readable manner. You designate each piece of data (value) with a key, and reference the data with that key. So in your case, the string “UUID” would be the key, and the actual unique ID would be the value.
In your example,
name1would actually be the key, wherekey1would be the value.In layman’s terms, the key is what comes before the equal sign (
=), and the value is what comes after it.