您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程

ecshop购物车关闭浏览器同时保存购物车商品的实现方法

凡蕾2023-12-17 20:04:12ecshop商城教程已有人查阅

导读init.php修改在最下面加if($_COOKIE['randnumber']==""){setcookie("randnumber",

init.php
修改
if (!defined('INIT_NO_USERS'))
{
include(ROOT_PATH . 'includes/cls_session.php');
$sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'));
define('SESS_ID', $sess->get_session_id());
}
if (!defined('INIT_NO_USERS'))
{
include(ROOT_PATH . 'includes/cls_session.php');
$sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'));
//define('SESS_ID', $sess->get_session_id());
}
在最下面加
if($_COOKIE['randnumber']==""){
setcookie("randnumber",rand(0,1000),time()+86400);
}
define('SESS_ID', md5($_COOKIE['randnumber'].real_ip()));

本文标签:

很赞哦! ()

留言与评论 (共有 条评论)
验证码:

本栏推荐

相关标签