doupeizheng3918 2014-01-23 20:00
浏览 40
已采纳

Kohana 3.3 - 未在IE中设置的会话

Having an issue with Sessions not being set in Kohana.

Situation overview:

  • Kohana 3.3
  • PHP 5.3.x
  • Using database sessions
  • Chrome, Firefox, Safari(OSX) are all working correctly.
  • Internet explorer- sessions are not being set- on versions 8-10 (testing with dev tools emulation)
  • Session is not even created in the database, which also happens when no encryption key is set (coincidence?)
  • Possible curveball- Server is behind a load balancer. Persistence is on and working, and this is actually the only server behind that load balancer so persistence is an unlikely culprit.

I've dug through the code a little, but cant find anything that would cause this to be an issue just for IE.

There are no dreaded underscores anywhere in the URL or hostname, and regardless of what I set the Cookie::$domain to, the result is the same.

session.php settings file:

return array(
    'native' => array(
        'name' => 'session_native',
        'lifetime' => 43200,
        'encrypted' => TRUE,
    ),
    'cookie' => array(
        'name' => 'session_cookie',
        'encrypted' => TRUE,
        'lifetime' => 43200,
    ),
    'database' => array(
        'name' => 'session_database',
        'encrypted' => TRUE,
        'lifetime' => 43200,
        'group' => 'default',
        'table' => 'sessions',
        'columns' => array(
            'session_id'  => 'session_id',
            'last_active' => 'last_active',
            'contents'    => 'contents'
        ),
        'gc' => 500,
    ),
);

Have set Session::$default = 'database';, though doesn't seem to be related to the IE-only issue. Have also tested with native sessions, same result.

Any thoughts or insights? Feel like I'm missing something completely obvious

  • 写回答

1条回答 默认 最新

  • dt4233 2014-01-30 19:44
    关注

    SOLVED:

    Turned out to be a missing Compact privacy policy. IE had stricter privacy settings by default, adding the below header fixed the issue (not ideal but doesn't require making an entire P3P file).

    /**
     * Added for P3P cookie support
     */
    header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘