Your session has expired. Please proceed to login again

I recently duplicated my site to another directory to do some special testing. But I can’t keep the login session to stick. Every page I open prompts me with “Your session has expired. Please proceed to login again.” How can I resolve this? I’ve cleared my cache directory, my cache/cookies in my browser and in the CMS. But I keep getting this error. Any suggestions?

thanks

Sounds like the MODX sessions configuration might have some values that are incompatible with your copy.

That could for example be the session_cookie_secure setting (https only), or a hardcoded session_cookie_domain setting.

Easiest way I know to sort these things out is to edit core/cache/system_settings/config.cache.php and doing a search there for session, making sure each setting is valid for your duplicate site and then logging in. It’s worthwhile clearing your cookies after making changes and trying to login, in case some cookies may prevent new ones from being set.

Important: Changes to the cache file are undone when the cache is cleared, so after getting into the manager this way, make sure to go to System > System Settings and also correct them there.

Both settings are set to nothing.

All of the “session” items are identical to the original site. I’ve cleared my cookies twice now too.

One thing I noticed is that the DB table modx_session has only 1 row and the original table has 5. I don’t know if this is relevant or not.

Except settings that are empty (which means they use a dynamic default) the settings may need to be different. But it’s hard to help without getting specific about the environment and configurations, which you may not necessarily want to post on a public forum.

Another potential reason for such session errors is incorrect paths, but I mostly see that on sites used for extra development where the extras are set up in such a way that it can be tested across different installations - so likely not what’s going on here.