I have a virtual host set up. My local url is http://test.local

When I start ngrok, my local url will become: http://test.local.ngrok.io so I changed my base secure and unsecure url to: http://test.local.ngrok.io/

My problem is that I cannot login anymore in admin side . I am getting this error validation error: Invalid Form Key. Please refresh the page., after I cleared my cache and session folder and deleted the web/cookie/cookie_domain & web/cookie/cookie_path from core_config_data.

Interesting part is if changed back my base url in http://test.local/ I can login instantly.

Any ideas what should I try more ?


It was a virtual host issue, I added one also for the ngrok domain and it worked

<VirtualHost *:80>
   ServerAdmin myemail@myemail.com
   ServerName test.local.ngrok.io
   ServerAlias www.test.local.ngrok.io
   DocumentRoot /var/www/html/myproject
   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined
   <Directory /var/www/html/myproject>
         Options Indexes FollowSymLinks Includes
         AllowOverride All
         Allow from All
         Require all granted  

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.