CakePHP Session Timeout on Inactivity only

前端 未结 5 590
别跟我提以往
别跟我提以往 2020-12-05 00:45

So the crux of this question is just how to prevent CakePHP from de-authenticating a session ONLY after a period of inactivity.

So, if the user does nothing then I e

5条回答
  •  温柔的废话
    2020-12-05 01:03

    I had the same issue and I fixed it by using the autoRegenerate option:

    Configure::write(
        'Session',
        array(
            'defaults' => 'cake',
            'timeout' => '30',
            'autoRegenerate' => true
        )
    );
    

    You could also use $this->Session->renew(); in your AppController.php class, but the above solution is my favourite.

提交回复
热议问题