I'm trying to set up a local dev environment using Vagrant and the Vaprobash script since I've used it before in several PHP based applications but for some reason I'm not able to login to the admin area.

I'm using this Vagrantfile and my fork of Vaprobash which only changes the nginx repo to use the 1.7 version so I end up with:

  • Nginx 1.7
  • PHP 5.5
  • MySQL 5.6

Which should be fine considering the system requirements for Magento 1.9.

I think it might be related to this answer in SO however I've tried several ways to fix it without luck:

  • I tried using Apache 2.2 instead of Nginx.
  • I'm not using localhost or any other one-word domain name, I tried using the IP of the virtual box and also mapped a magento.local.dev domain in my hosts file.
  • I tried storing sessions in files and database, both are getting stored just fine so it doesn't seem like a permissions issue.
  • I tried commention out the $cookieParams lines in the Varien.php file and it didn't work so it might not be related to the cookies.
  • I tried running the installer from the web interface, command line and the magerun script.
  • I ran the magerun sys:check command and everything returned green.

There was a moment where I could make it work but I'm not exactly sure what I did because I was trying so many things, I remember opening incognito mode in Chrome, clearing the cookies and login in just fine but I destroyed the box to se if I could reproduce it and I couldn't.

I've managed to set it up using a much simpler script however I'm not sure what the difference might be, maybe it's because I'm using php-fpm but I've seen it work with Magento before. I'm thinking it might be some server setting or something like that but I can't see what it might be.

EDIT: I just noticed I can't add products to the shopping cart from the frontend, it could be part of the same problem.

2 Answers 2


Looks like a cookie issue to me. Can you check what are values for web/cookie/cookie_path and web/cookie/cookie_domain in core_config_data table.

Try setting them to NULL and see if it works.

  • They are both set to NULL, I tried changing the path to "/" and domain to ".magento.local.dev", cleared the cache and browser cookies but still no luck Dec 27, 2014 at 0:34
  • I'll give it another tough but I am lost. I see you did you research so if you find what it was let us know please. Dec 27, 2014 at 12:01
  • Yes it's really weird, hopefully someone can replicate it on their end to see if it's just me or the actual Vagrant script Dec 28, 2014 at 18:08
  • I've set up a box using your Vagrantfile with everything on default settings. I had no issues logging into admin. Dec 29, 2014 at 3:31
  • Strange, what URL did you use? Did you use the default virtual host with the document root in the /vagrant folder? Also how did you install Magento? Dec 30, 2014 at 16:25

In Case, that you dont see any cookie named frontend or adminhtml, when you reload the page, the Magento cookie wasn't set. In my case I have a wrong cookie_domain. I used null instead of NULL.

As I set my cookie_domain to NULL in core_config_data, the problem was solved.

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.