4

I'm having the problem where I can't log into the backend of Magento 1.8 after I've pulled it onto my local vagrant box. When I log in using an incorrect password, I get an error message. When I use correct credentials, it just loops. I've tried:

  1. Making sure I'm not using local host. I've set it up so I'm using www.ared.dev on the local machine.
  2. Making sure all URLs have been updated in core_config_data.
  3. Made sure timezone is set correctly.
  4. Checked that cookies were being set and not immediately expiring (Domain on the cookie is showing up as .www.ared.dev (I'm not sure if the dot in front of the domain is a clue to what the problem may be or not)
  5. Checked that I don't have multiple adminhtml stored in my browser
  6. My store method is "Files" and I see sessions being wrote to /var/session
  7. I even tried the core hack to /app/code/core/Mage/Core/Model/Session/Abstract/Varien.php. That didn't work either.

I'm starting to run out of posts to Google.

The error message I'm getting in the logs is: ERR (3): Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/www/XXXX/var/session) in Unknown on line 0

7

I gave an answer here https://stackoverflow.com/a/26827987/1627367

I had the same issue with vagrant, I fixed it by changing the session.save_path to place it in the VM.

Change the file app/etc/local.xml

<config>
    <global>
        ...
        <session_save><![CDATA[files]]></session_save>
        <session_save_path>
            <![CDATA[/tmp/session]]>
        </session_save_path>
     </global>
     ...
</config>

Clear your cache and restart apache if you have a php accelerator:

sudo rm -R var/cache/* var/session/*
sudo rm -R var/session
sudo service apache2 restart

Hope this help.

1

user3116226,

Your problem is permission's related. Basically, your Magento is trying to save your session into the disk and getting the permissions denied. You can see that by running:

tail -f /path_to_magento/var/log/system.log

You will probably see something like that:

2014-08-19T08:15:33+00:00 ERR (3): Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct

There are two options to fix it: 1) Add the right permissions for the path indicated on the log; 2) Change your file app/etc/local.xml to db storage:

<session_save><![CDATA[db]]></session_save>

That should do the trick.

  • I gave those guys a shot and they didn't work. It's something quite mysterious. – user3116226 Aug 19 '14 at 18:57
1

If anyone else stumbles upon none of the above suggestions working, I finally got my set up to work. I wound up just upgrading Vagrant and then reprovisioning the machine and everything started working again. I'm still not sure why it wasn't allowing me to log in, but at least I'm back in business now.

1

Restarting apache server worked for me.

0

You can test this:

under System -> Configuration -> Web -> Session Validation Settings

Set to “NO” the following:

Validate REMOTE_ADDR
Validate HTTP_VIA
Validate HTTP_X_FORWARDED_FOR

this solution is not correct but for testing is valid...

In file: app/code/core/Mage/Core/Model/Session/Abstract/Varien.php

Search this piece of code:

$cookieParams = array(
            'lifetime' => $cookie->getLifetime(),
            'path'     => $cookie->getPath()
            'domain'   => $cookie->getConfigDomain(),
            'secure'   => $cookie->isSecure(),
            'httponly' => $cookie->getHttponly()
        );

And comment these lines:

$cookieParams = array(
            'lifetime' => $cookie->getLifetime(),
            'path'     => $cookie->getPath()
            // 'domain'   => $cookie->getConfigDomain(),
            // 'secure'   => $cookie->isSecure(),
            // 'httponly' => $cookie->getHttponly()
        );
  • Thanks for the suggestion. Unfortunately, this didn't do the trick. In fact, none of the core hacks I've been seeing in the forums have been helping. – user3116226 Aug 12 '14 at 15:37
  • You have correct permissions in folder "var"? Try this: sudo chmod -R 0777 var – osrecio Aug 12 '14 at 17:12
  • That didn't seem to be it either. The permissions are wide open and when I try to log in it is creating files in the /var/sessions directory. – user3116226 Aug 13 '14 at 15:06
  • You can try to install other version of Magento (1.7 or 1.9). If problem persist I thinkthe problem can be PHP or Apache or your vagrant configuration. – osrecio Aug 14 '14 at 8:51
  • This is a bad approach. I see it recommended all over the net. Modifying the core is not the solution. For sure the problem can be solved differently. Unfortunately I don't have a solution for this specific case, but I know for sure this is not the way to go. Those lines are there for a reason. – Marius Nov 12 '14 at 8:01
0

I recently had the same problem and simple trick worked for me. Also this is for people who cannot access the dashboard on Google Chrome. If you can please carry on by working on Mozilla Firefox then please do so because I guess this issue is not persistent on Mozilla firefox.

So the solution for chrome is:

Goto System->Configuration->Web. Expand the Unsecure and Secure tab. Change the Base URL to http://127.0.0.1/[Your folder name] if your using localhost or change it to your Site URL through which you are accessing the frontend. I had to login twice to get the Dashboard since when I entered the details for the first time, it just refreshes and comes back to the same page as you mentioned it as looping. Please try and let me know whether it worked for you too.

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.