Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Session 如何在Concrete 5.7中延长默认会话持续时间?_Session_Concrete5_Concrete5 5.7 - Fatal编程技术网

Session 如何在Concrete 5.7中延长默认会话持续时间?

Session 如何在Concrete 5.7中延长默认会话持续时间?,session,concrete5,concrete5-5.7,Session,Concrete5,Concrete5 5.7,如何延长Concrete5 CMS(v5.7)中会话的默认持续时间?感觉好像我不得不再次登录太频繁了。我发现实现这一点的一种方法是修改/application/config/concrete.php中的会话处理设置: return [ //----------------------- SUPER LONG SESSIONS ------------------------- // We want to extend the session cookie to last for 4

如何延长Concrete5 CMS(v5.7)中会话的默认持续时间?感觉好像我不得不再次登录太频繁了。

我发现实现这一点的一种方法是修改
/application/config/concrete.php中的会话处理设置:

return [

   //----------------------- SUPER LONG SESSIONS -------------------------
   // We want to extend the session cookie to last for 4 months
   // so that users are not bugged for their password all the time.
   // WARNING: This does reduce security and potentially increase the chance of 
   //          session-hijacking but if you're willing to make the trade-off, here goes

   'session'           => [
       'name'         => 'CONCRETE5',
       'handler'      => 'file',

       // We'll use our own specific save_path so that others on our 
       // server don't garbage-collect our sessions
       'save_path'    => DIR_APPLICATION . '/files/tmp/sessions',

       // 40 days (in seconds). This is a timeout value.
       // If session is not used for 40 days, it is likely to be garbage collected
       'max_lifetime' => 3456000,           

       'cookie'       => [
           'cookie_path'     => false,

           // This defaults to 0 which is a session cookie
           // (ends when browser is closed)
           // Extending to last 4 months (in seconds). Cookie will span multiple 
           // browser restarts up until this max value, and then user will be forced 
           // to login again (yes, even in the middle of a session, beware!)
           'cookie_lifetime' => 10510000,    

           'cookie_domain'   => false,
           'cookie_secure'   => false,
           'cookie_httponly' => true
       ]
   ],

   // Browser user-agents and IP addresses may change within that time
   // so we will disable strict checking for those
   'security' => [
       'session' => [
           'invalidate_on_user_agent_mismatch' => false,
           'invalidate_on_ip_mismatch' => false
       ],
   ]

];
旁注:
成员所属的特定组存储在会话中,仅在登录时或在仪表板中更改某些权限时刷新。发生这种情况时,Concrete5会自动更新
/application/config/generated\u overrides/concrete.php
中的时间戳,但如果您想强制在会话中期刷新用户权限,也可以手动执行此操作:

return array(
    ...
    'misc' => array(
        'access_entity_updated' => 1453869371,
    ),