我在codeigniter会话中遇到一些问题,当页面加载期间未设置页面load..session值时...意味着某些会话变量未设置(表示空)...页面加载前的会话变量..
Array ( [session_id] => 2de4cec5bf6cdf3ccc5b02844a4b572a
[ip_address] => 127.0.0.1
[user_agent] => Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/2010010
[last_activity] => 1320479523
[logoff_city] => Agra
[user_deal_point] => 460
[userid] => 2
[email] => test@dummyid.com
[asfsadf] =>
[userId] =>
[city_name] => Agra
[city_id] => 1
[deal_id] => KGrNM03
[amount] => 449
[total_amount] => 449
[UserName] =>
[UserEmail] =>
[Mobile] => )
页面加载后显示会话变量
Array ( [session_id] => 2de4cec5bf6cdf3ccc5b02844a4b572a
[ip_address] => 127.0.0.1
[user_agent] => Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/2010010
[last_activity] => 1320479523
[logoff_city] => Agra
[user_deal_point] =>
[userid] => 2
[email] => test@dummyid
[asfsadf] =>
[userId] =>
[city_name] => Agra
[city_id] => 1
[UserName] =>
[UserEmail] =>
[Mobile] => )
答案 0 :(得分:2)
您是否已从1.7版本的CodeIgniter升级到2.0版本?你在数据库表中存储会话吗?你在使用IE吗?如果是这样,我有同样的问题。当我将会话表user_agent字段编辑为varchar(255)时,它已得到修复。这是IE的一个问题。
答案 1 :(得分:0)
请参阅此处了解此问题的答案:Losing a session variable between one page with codeigniter session library
总而言之,您缺少资源文件。
祝你好运!