开发者

How to append values to a cookie instead of overriding the existent values in JavaScript?

开发者 https://www.devze.com 2023-03-12 06:24 出处:网络
For example for the following cookie: Cookie name: favAnimal Existent value: donkey I want to append this value:

For example for the following cookie:

Cookie name: favAnimal
Existent value: donkey

I want to append this value:

tiger

without deleting donkey. How to do that? I know I can read the current cookie value, add tiger to that and set the new string as the new cookie value but was wonderi开发者_高级运维ng if there was a better way.

0

精彩评论

暂无评论...
验证码 换一张
取 消