For a few hours I could not login on frontend. (on local domain https://www.magento2.loc, magento 2.2.5, developer mode). If I enter wrong username or password, yes, I receive error message. With correct credentials it just reloaded the login page, that's all. Googling around did not help. I tried all possible settings with cookies and sessions, cleared generated, cache and sessions directories, disabled all modules in app/code and switched to blank theme. The backend, by the way, worked normally. I could log in and out to the dashboard.

The problem was solved by itself when I restarted the computer (MAC, El Capitan) and crossed my fingers.

The question is what could it be? And how to prevent it in production environment?


2 Answers 2


I think issue is regarding session, by default session store in files in Magento, you can try to change it to DB for your local instance and try if your problem resolve or not. You can change session storage location from


Replace this:

'session' => [
        'save' => 'files'

With :

'session' => [
            'save' => 'db'

On production I think you have to store session on Redis server https://devdocs.magento.com/guides/v2.0/config-guide/redis/redis-session.html

  • That's good idea, and I have not tried this yet. Now I'll be waiting the problem to appear again as I do not know what caused it.
    – melaxon
    Commented Sep 18, 2018 at 9:56

Try this:

  1. Set a domaine cookie in : Admin > System > Configuration > Web > Default Cookie Settings

  2. Use HTTP Only > Yes

  3. Cookie Lifetime > 3600

  4. Clean the content of var/session

  5. Clean and flush the cache.

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.