2017-04-24 4 views
1

CakePHP 2のセッションの有効期限を延ばす方法を教えてください。cakephp 2のログイン時間を増やす方法

現在、以下のように設定しています。

Configure::write('Session', array(
     'defaults' => 'php', 
       'timeout' => 129600, // The session will timeout after 30 minutes of inactivity 
       'cookieTimeout' => 129600, // The session cookie will live for at most 24 hours, this does not effect session timeouts 
       'ini' => array(
        'session.gc_maxlifetime' => 129600 // 36 hours 
       ) 
    )); 

しかし、これらの設定は機能しないと、セッションはこのスレッドは私の問題を解決していなかった「How to increase cakephp Auth component session expire time

+1

可能な重複[cakephpのAuthコンポーネントのセッションを高めるためにどのようにトンを期限切れにあなたの条件に応じて時間を追加します。 ime](http://stackoverflow.com/questions/30694932/how-to-increase-cakephp-auth-component-session-expire-time) – drmonkeyninja

+0

上記の質問に言及してみました。それは私のために働かなかった。 –

答えて

0

アプリケーション

のcore.phpのファイルにこの設定を追加 ほぼ24 minutes.Thanks期限切れ
Configure::write('Session', array(
'defaults' => 'cache',//default session 
'timeout' => '<time_in_minute>',//in minutes 
'cookieTimeout' => '<time_in_minute>',//in minutes 
'ini' => array('session.cookie_domain' => env('HTTP_BASE')), 
'handler' => array(
    'config' => '<handler>' //if you are using default sessions then this field is not necessary 
) 
)); 

+1

このコードは動作しませんでした。私もログインできませんでした。 –

関連する問題