dth2331 2010-08-19 12: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-19 23: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 ?

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

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部