SSL安全站点上的Magento cookie中的“安全”标记在哪里?

时间:2014-11-07 02:19:57

标签: php magento cookies http-headers

我们的网站是SSL安全网站,Magento'安全'和'不安全'的URL变量都指向https:// URL。但PCI审计表明,cookie是不安全的。当通过页眉中的Set-Cookie创建cookie时,他们希望看到'secure'关键字。

我看到Magento在\ shop \ app \ code \ core \ Mage \ Core \ Model \ Cookie.php中使用此功能

if (is_null($secure)) {
            $secure = $this->isSecure();
        }
        if (is_null($httponly)) {
            $httponly = $this->getHttponly();
        }

        setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);

但我不确定isSecure()的来源是什么,为什么不包含'secure'文本?

页面标题中的SetCookie:

frontend=sj4j9kltv7nc00gk8s0i81koi3; expires=Thu, 06-Nov-2014 23:39:11 GMT; 
path=/; domain=www.mydomaine.com; HttpOnly"

1 个答案:

答案 0 :(得分:7)

Magento仅为管理员设置安全cookie,尝试安装http://www.magentocommerce.com/magento-connect/secure-frontend-cookie.html模块,它应该有帮助:)

如果从isSecure模型覆盖Mage_Core_Model_Cookie无效帮助,方法:

public function isSecure()
{ 
    return $this->_getRequest()->isSecure(); 
}