会话在CodeIgniter上不起作用 [英] Session not working on CodeIgniter

查看:68
本文介绍了会话在CodeIgniter上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我的会话无法在CodeIgniter上运行,请帮忙。.以下是我的配置

Hi guys my session is not working on CodeIgniter, please help.. Following is my config

$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

我的设置如下

$this->session->set_userdata('test', "Hello world!");

并尝试按以下方式检索并打印为空

And trying to retrieve as follows and it prints empty

$this->session->userdata('test')

打印所有会话

var_dump($this->session->all_userdata());

打印

array(1) {
  ["session_id"]=>
  string(32) "968esdf9539d0bdc29faeb48ad86948"}

我已经通过 https://forum.codeigniter.com/post-325982.html

推荐答案

这是CodeIgniter本身的问题
用最新版本的 system 文件夹替换codeIgniter,它开始工作,替换为版本 3.1.0 。我正在使用 3.0

This is an issue with CodeIgniter itself Replace the system folder with the latest version of codeIgniter and it started working, replace with version 3.1.0 . I was using 3.0

这篇关于会话在CodeIgniter上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆