userAgent在cakePHP中使用了什么?

时间:2010-12-15 05:49:40

标签: cakephp

debug($session->read());
Array
(
    [Config] => Array
        (
            [userAgent] => 85b3b055be0e89d07016e8c67e3e9d69
            [time] => 1292403988
            [timeout] => 10
        )

)

Session中的userAgent用于什么。我认为是这样的:User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8 FirePHP/0.4

1 个答案:

答案 0 :(得分:4)

这与/app/config/core.php中的此设置有关:

/**
 * When set to false, HTTP_USER_AGENT will not be checked
 * in the session. You might want to set the value to false, when dealing with
 * older versions of IE, Chrome Frame or certain web-browsing devices and AJAX
 */
    Configure::write('Session.checkAgent', true);

它只是用户代理的hash,用作额外的安全措施,以确保会话cookie对于一台计算机/浏览器是唯一的。