CakePHP Session keeps getting reset
I'm setting a Session variable with an ajax call. I've tried both by using the helper and by using the straight PHP $_SESSION syntax. For some reason, whenever I reload the page, all 开发者_如何学JAVASESSION data is gone.
What is annoying about this, is that it happens sporadically. I thought at first, it had to do with the browser I was using, but it does not. I have tried changing all the Session settings in core.php and no combination seems to be reliable.
Any thoughts as to how I can fix this problem?
You'll want to open the app/config/core.php
file and modify the Security.level
section. From the manual:
Security.level
The level of CakePHP security. The session timeout time defined in 'Session.timeout' is multiplied according to the settings here.
Valid values: 'high' = x 10 'medium' = x 100 'low' = x 300
'high' and 'medium' also enable session.referer_check
CakePHP session IDs are also regenerated between requests if 'Security.level' is set to 'high'.
Search the core.php
file for Security.level
and change the setting to low
and ensure you Session.timeout
value is high enough. You may have to play with both of these settings until your satisfied.
精彩评论