dth2331 2010-08-19 20:19
浏览 39
已采纳

PHP 5.3.2和Zend Framework会话

We recently upgraded our PHP and apache versions on our server.

Prior to this our sessions were able to be carried over between subdomains without error.

Unfortunately when we made the upgrades it stopped working.

From what I can see everything is the same.

I have tried ini_set("suhosin.session.cryptdocroot", "Off"); ini_set("suhosin.cookie.cryptdocroot", "Off");

But that didn't work out.

I am already setting in my Bootstrap the cookie_domain to ".website.com".

Anybody have any ideas what could possibly have changed to make this great of an impact!?

Here's the code:

ini_set('session.use_cookies', 1);
    ini_set('session.use_only_cookies', 1);
    ini_set('session.cookie_domain', '.website.com');

    $db = Zend_Registry::get('db_global');  
    $config = array(
        'name'           => '_sessions',
        'primary'        => 'id',
        'modifiedColumn' => 'modified',
        'dataColumn'     => 'data',
        'lifetimeColumn' => 'lifetime',
        'customerIdColumn' => 'customer_id',
        'db' => $db   // db adapter
    );

    //I tried it with the typical savehandler and got the same result of not working
    Zend_Session::setSaveHandler(new Custom_Session_SaveHandler_DbTable($config));
    Zend_Session::start();
  • 写回答

1条回答 默认 最新

  • du3979 2010-08-20 07:32
    关注

    You can configure Zend_Session for the cookie_domain, best place is your bootstrap:

    Zend_Session::start(array('cookie_domain' => '.domain.com'));
    

    An other idea: New settings in php.ini like session.auto_start = true ?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测
  • ¥88 python部署量化回测异常问题
  • ¥30 酬劳2w元求合作写文章
  • ¥15 在现有系统基础上增加功能
  • ¥15 远程桌面文档内容复制粘贴,格式会变化