Codeigniter increase session time out not working

后端 未结 2 1467
Happy的楠姐
Happy的楠姐 2021-01-07 13:30

I am new to codeigniter framework. I have a problem with session time out with pages. Right now I had enabled with the ip match ,user agent matching but doesn\'t work.

2条回答
  •  花落未央
    2021-01-07 14:23

    if you dont have ci_sessions table in your database, create it using the following script.

    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(120) NOT NULL,
        last_activity int(10) unsigned DEFAULT 0 NOT NULL,
        user_data text NOT NULL,
        PRIMARY KEY (session_id),
        KEY `last_activity_idx` (`last_activity`)
    );
    

    use $this->session->set_userdata($array); to get session data. Then it should work properly

提交回复
热议问题