dongzhang1987 2014-02-15 09:19
浏览 47
已采纳

Codeigniter会话无法在IE和Safari中使用

It seems like Codeigniter session is not working in ie & safari. Any one else has faced the same problem?

Is there any solution about this?

<?php defined('BASEPATH') OR exit('No direct script access allowed');

class Test extends CI_Controller {

    var $user;

    public function __construct(){
        parent::__construct();
    }

    public function index(){
        $this->session->set_userdata('test', 'denis');
        var_dump($this->session->all_userdata());
    }

    public function test2(){
        var_dump($this->session->all_userdata());

        phpinfo();
    }
}

response for http://mydomain.com/test

array(5) { ["session_id"]=> string(32) "47d3fec20fc0360ae19994bad84294ba" ["ip_address"]=> string(10) "172.16.1.1" ["user_agent"]=> string(68) "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko" ["last_activity"]=> string(10) "1392434286" ["test"]=> string(5) "denis" }

response for http://mydomain.com/test/test2

array(4) { ["session_id"]=> string(32) "5c38c5bc9e1fea7990962fad7626dbd5" ["ip_address"]=> string(10) "172.16.1.1" ["user_agent"]=> string(68) "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko" ["last_activity"]=> string(10) "1392434287" }

It doesn't store the cookie, the session is empty.

  • 写回答

3条回答 默认 最新

  • douya2433 2014-02-15 10:37
    关注

    Just Found the problem:

    It wasn't codeigniter bug. The problem was on my linux server configuration.

    The hwclock was not coresponding with the date time, and this was causing the session problem on ie & safari...

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料