【问题标题】:where is 'secure' tag in Magento cookie on SSL secure site?SSL 安全站点上 Magento cookie 中的“安全”标签在哪里?
【发布时间】:2015-01-03 18:10:52
【问题描述】:

我们的站点是 SSL 安全站点,Magento 的“安全”和“不安全”URL 变量都指向 https:// URL。然而 PCI 审计表明 cookie 是不安全的。当通过页面标题中的 Set-Cookie 创建 cookie 时,他们希望看到“安全”关键字。

我看到 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() 的值来自哪里以及为什么不包含文本“安全”?

在页眉中设置Cookie:

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

【问题讨论】:

    标签: php magento cookies http-headers


    【解决方案1】:

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

    如果没有帮助,只需从 Mage_Core_Model_Cookie 模型覆盖 isSecure,方法:

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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-21
    • 2023-03-31
    • 2016-01-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多