sharpmental 发表于 2015-10-20 16:58:40

如何使用session?

本帖最后由 sharpmental 于 2015-10-21 11:17 编辑

我在用户登录这边输入用户名和密码,数据库读取检查都没问题。

if($this->User_model->validate_user()){
    $data = array(
    'user_name' => $this->input->post('username'),
    'privilege' => $this->User_model->get_user_privilege($this->input->post('username')),
    'is_loged_in' => 1,
    'group_id'    =>$this->User_model->get_group_id($this->input->post('username')));
//$this->session->set_userdata($data);



不加最后那句,返回就是正常的。加上最后那句,就返回一个500错误。

这是我的设置。似乎教程和别人的帖子都没写encryption_key,但是不加index页面就显示个错误。

$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = "C:\xampp\tmp";
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
$config['encryption_key'] = '1234567';
$config['sess_encrypt_cookie'] =TRUE;



session文件在C:\xampp\tmp确实是创建了的。


这个如何debug?

sharpmental 发表于 2015-10-21 11:16:33

求助!!!
页: [1]
查看完整版本: 如何使用session?