Craft: 2.6.3013 (Personal)
MAMP Pro: 4.4.1
PHP: 7.0.12 (CGI Mode)

After logging into the CP, and following a relatively short period of time, the session expires unexpectedly and Craft requests a login. Attempting to log in fails and immediately returns to the login modal; however, simply refreshing the page re-establishes the session, but again for only the limited period of time.

Looking at /craft/storage/runtime/sessions I see that Craft is creating a number of sessions, some of them being zero bytes.

Attempted Solutions
I've tried the following, based on other users' past experiences and solutions:

  • In general.php: 'requireMatchingUserAgentForSession' => false
  • In general.php: 'overridePhpSessionLocation' => true
  • In php.ini: session.auto_start = 0
  • Permissions set to 777 for /craft/storage/runtime
  • In MAMP, enable/disable "Xdebug (Debugger)" PHP extension
  • Lastly, tested in both PHP 7.0.12 and 5.6.32 without CGI mode

Next Steps?
Does it appear that I've missed anything in my previous steps? I've been using Craft 2 for a couple of years in a variety of environments--MAMP 3 / Vagrant / Docker--and haven't experienced this before. The issue isn't a showstopper, but certainly an annoyance, and I would be grateful for thoughts on what to try next.


1 Answer 1



This ended up being an issue with, so far as I can tell, my env variables--specifically a misconfiguration with the basePath.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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