PHP开发实例大全(提高卷) 中文完整pdf扫描版[244MB]
有时候我们在Discuz整合ECShop同步的时候,登出无法同步,那么就可以参考下面的修改方法
修改办法:
找到ecshop中的文件:修改ecshop/api/uc.php
如下代码中if(empty($user_id))修改为if(!empty($user_id))
/** * 设置cookie * * @access public * @param * @return void */ function set_cookie($user_id='', $user_name = '', $email = '') { if (!empty($user_id)) { /* 摧毁cookie */ $time = time() - 3600; setcookie('ECS[user_id]', '', $time); setcookie('ECS[username]', '', $time); setcookie('ECS[email]', '', $time); } else { /* 设置cookie */ $time = time() + 3600 * 24 * 30; setcookie("ECS[user_id]", $user_id, $time, $GLOBALS['cookie_path'], $GLOBALS['cookie_domain']); setcookie("ECS[username]", $user_name, $time, $GLOBALS['cookie_path'], $GLOBALS['cookie_domain']); setcookie("ECS[email]", $email, $time, $GLOBALS['cookie_path'], $GLOBALS['cookie_domain']); } }