Codeigniter在每次页面加载时创建新会话 [英] Codeigniter creating new session on every page load
本文介绍了Codeigniter在每次页面加载时创建新会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用codeigniter 2.1.0为客户开发和电子商务站点。
该站点已经运行了大约3个月,然后突然间,登录不固定,未设置会话数据。
我检查了数据库,发现每次页面加载时都在创建一个新会话。
I used codeigniter 2.1.0 to develop and e-commerce site for a client. The site has been working well for about 3 months then all of a sudden, logins were not sticking, session data was not being set. I checked the database and noticed a new session was being created on every page load.
这是我的配置值
$config['sess_cookie_name'] = 'myu';
$config['sess_expiration'] = 7200;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = TRUE;
$config['sess_table_name'] = '_sessions';
$config['sess_match_ip'] = TRUE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 3600;
$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
$config['cookie_secure'] = FALSE;
我编辑了会话表上的user_agent字段以容纳较长的user_agent字符串。
可能是什么问题?我将不胜感激
I edited the user_agent field on session table to accommodate long user_agent strings. What could be the problem? i'll be greatful for any help
推荐答案
请确保您在 / application /中设置了正确的域config / config.php
在 $ config ['cookie_domain']
这篇关于Codeigniter在每次页面加载时创建新会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文