update cookie value in php

蓝咒 提交于 2019-11-29 16:23:07

You can simply store the unserialized cookie into a variable then reset the cookie?

$array = unserialize(urldecode($_COOKIE['Promotedcart']));  
$array[0]["PromoteuserId"] = "New";

setcookie("Promotedcart", urlencode(serialize($array)), time()+604800,'/');

this link best simplify using Serialize and Unserialize data

https://stackoverflow.com/questions/9032007/arrays-in-cookies-php/9032082#9032082
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!