|
我建了数据库存放session,数据库为
CREATE TABLE IF NOT EXISTS `ci_sessions` (
session_id varchar(40) DEFAULT '0' NOT NULL,
ip_address varchar(16) DEFAULT '0' NOT NULL,
user_agent varchar(50) NOT NULL,
last_activity int(10) unsigned DEFAULT 0 NOT NULL,
user_data text DEFAULT '' NOT NULL,
PRIMARY KEY (session_id)
);
登录时用$this->session->set_userdata($data)设置了session,紧接着在下面打印出session也是正常的,例如
array(7) { ["session_id"]=> string(32) "405e48ddc4f1117960ed6da3c0709265" ["ip_address"]=> string(9) "127.0.0.1" ["user_agent"]=> string(67) "Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1" ["last_activity"]=> int(1319269453) ["username"]=> string(4) "root" ["uid"]=> string(1) "8" ["hasLogin"]=> bool(true) } 。
但是跳到别的页面打印出的session却是这样的
array(4) { ["session_id"]=> string(32) "fdc464918509accb3742417eca12d65d" ["ip_address"]=> string(9) "127.0.0.1" ["user_agent"]=> string(67) "Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1" ["last_activity"]=> int(1319269739) }
少了后面的几项,这是为什么呢?高手给看看
|
|