0

I have used CakePHP in my application. But it has a weird problem. Some times a user is being automatically logged out after within few secs. How to stop this auto log out?

I have set below codes in my app/config/core.php:

Configure::write('Session.timeout', '120');
Configure::write('Security.level', 'low');
JJJ
  • 32,902
  • 20
  • 89
  • 102
Priyabrata
  • 629
  • 1
  • 8
  • 23

2 Answers2

1

The best way is to set session time out in the app/Config/core.php.

Configure::write('Session', array(
        'defaults' => 'php',
                'timeout' => 20,//20minutes
                'autoRegenerate' => true,//resets session on activity
                'cookieTimeout' => 1440
    ));
JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Stallion
  • 77
  • 4
0

I had a similar problem once. At that time the random loggin out stopped after I fixed a 404 request on one of the images called by a .css file. By that time I was running CakePHP 1.3 though and I have never had a similar issue on CakePHP 2.0

Its commentend on the answers for this question CakePHP session/auth logging out intermittently that:

The 404 request apparently can reset the Cake Auth/Session, not a generic PHP issue

Community
  • 1
  • 1
huoxito
  • 560
  • 6
  • 7