The problem seem to be that the session file in /craft/storage/runtime/sessions is getting removed any time I refresh the actual page, so that I have to do a new login everytime I've changed content, looked at the site, and then want to add more content.

This i running on Apache, PHP 5.3.29, locally through MAMP on Yosemite.

Is there some config setting I'm missing here?

  • Ok, don't really think it counts as a solution, more of a workaround, but setting 'userSessionDuration' to false in /craft/config/general.php prevents this from happening.
    – megatrond
    Nov 10, 2014 at 12:20
  • There's also a number of good answers at Craft constantly logging out from admin area
    – Simon East
    Jul 19, 2018 at 7:36

2 Answers 2


The problem was actually Chrome using iOS emulation when viewing the site, thus spoofing the UA string into something different than the usual Chrome UA string when logging into the admin area.

Solution (as suggested by @craftcms on Twitter) was to set:

'requireMatchingUserAgentForSession' => false



For whatever environment you are having the issue.


As Brad Bell mentioned in this answer:

It can be that wherever Apache/PHP is configured to save session files doesn't exist or isn't writable.

If you've got the overridePhpSessionLocation config setting set to true, then that will be in craft/storage/runtime/sessions folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.