Magento 2 : Invalid Key. Please Refresh The Page as we create / login to account

I have installed LAMP (Stack) to my Ubuntu laptop and successfully installed Magento 2.x

So the problem occurred when I need to log in with the customer account at the front-site

I have error message “Magento 2 : Invalid Key. Please Refresh The Page”

so here is the solution I’ve done before

  1. Edit my php.ini files and increase php_value_max_input_vars to 75000 or higher.
  2. Restart my apache server
  3. Clear browse cache
  4. Try to login/create account again

Debugging Code

CodeIgniter 3.x
Create helper file inside application/helper

function debug($data) {
 echo "<pre>";
 print_r($data);
 echo "</pre>";
 exit;
}

Call it with $autoload[‘helper] in application/config/autoload.php

Use it with parameter debug($parameter)

Example:

 $data = array(
   "var1" => "variable #1", 
   "date" => date('Y-m-d H:i:s')
 );
 debug($data);

so you will get the view like this

Debugging in Codeigniter - Silumansupra.com