magento-lts icon indicating copy to clipboard operation
magento-lts copied to clipboard

Admin Login succeeds but shows error "invalid form key"

Open alexh-swdev opened this issue 7 months ago • 2 comments

Preconditions (*)

  1. OM 20.1.0 and still in OM 20.2.0
  2. PHP 8.1
  3. backend renamed from the default to, e.g. "workspace"
  4. Using "sales" as entrypoint instead of the dashbaord (or whatever is the default)
  5. Using the openmage admin theme

Steps to reproduce (*)

  1. Go to the admin
  2. Login

Expected result (*)

  1. Login completes without any error messages

Actual result (*)

  1. Login is successful (meaning the backend is showing up and one can work as expected)
  2. Error message "invalid formkey" (twice) comes up directly after login grafik

The log is empty, I put some output via var_export() to the log for the login process:

2023-11-19T13:54:34+00:00 ERR (3): Mage_Core_Controller_Varien_Action::_validateFormKey: formkey: EHKCL7TOyhs9v0YL, expected: oPjQzFNAKvcLQQ1Z
2023-11-19T13:54:34+00:00 ERR (3): Mage_Core_Controller_Varien_Action::_validateFormKey: request: Mage_Core_Controller_Request_Http::__set_state(array(
   '_dispatched' => false,
   '_module' => 'workspace',
   '_moduleKey' => 'module',
   '_controller' => 'index',
   '_controllerKey' => 'controller',
   '_action' => 'login',
   '_actionKey' => 'action',
   '_params' => 
  array (
    'key' => '814c5d9d7336582336dabb49b79f1193',
    'messageSent' => true,
    'forwarded' => true,
  ),
   '_paramSources' => 
  array (
    0 => '_GET',
    1 => '_POST',
  ),
   '_requestUri' => '/index.php/workspace/index/index/key/814c5d9d7336582336dabb49b79f1193/',
   '_baseUrl' => '/index.php',
   '_basePath' => '',
   '_pathInfo' => '/workspace/index/index/key/814c5d9d7336582336dabb49b79f1193/',
   '_rawBody' => NULL,
   '_aliases' => 
  array (
  ),
   '_originalPathInfo' => '/workspace/index/index/key/814c5d9d7336582336dabb49b79f1193/',
   '_storeCode' => NULL,
   '_requestString' => '/workspace/index/index/key/814c5d9d7336582336dabb49b79f1193/',
   '_rewritedPathInfo' => NULL,
   '_requestedRouteName' => NULL,
   '_routingInfo' => 
  array (
  ),
   '_route' => 'adminhtml',
   '_directFrontNames' => 
  array (
    'api' => '',
  ),
   '_controllerModule' => 'Mage_Adminhtml',
   '_isStraight' => false,
   '_beforeForwardInfo' => 
  array (
  ),
   '_internallyForwarded' => true,
))
2023-11-19T13:54:34+00:00 ERR (3): Mage_Core_Controller_Varien_Action::_validateFormKey: formkey: EHKCL7TOyhs9v0YL, expected: oPjQzFNAKvcLQQ1Z
2023-11-19T13:54:34+00:00 ERR (3): Mage_Core_Controller_Varien_Action::_validateFormKey: request: Mage_Core_Controller_Request_Http::__set_state(array(
   '_dispatched' => true,
   '_module' => 'workspace',
   '_moduleKey' => 'module',
   '_controller' => 'index',
   '_controllerKey' => 'controller',
   '_action' => 'login',
   '_actionKey' => 'action',
   '_params' => 
  array (
    'key' => '814c5d9d7336582336dabb49b79f1193',
    'messageSent' => true,
    'forwarded' => true,
  ),
   '_paramSources' => 
  array (
    0 => '_GET',
    1 => '_POST',
  ),
   '_requestUri' => '/index.php/workspace/index/index/key/814c5d9d7336582336dabb49b79f1193/',
   '_baseUrl' => '/index.php',
   '_basePath' => '',
   '_pathInfo' => '/workspace/index/index/key/814c5d9d7336582336dabb49b79f1193/',
   '_rawBody' => NULL,
   '_aliases' => 
  array (
  ),
   '_originalPathInfo' => '/workspace/index/index/key/814c5d9d7336582336dabb49b79f1193/',
   '_storeCode' => NULL,
   '_requestString' => '/workspace/index/index/key/814c5d9d7336582336dabb49b79f1193/',
   '_rewritedPathInfo' => NULL,
   '_requestedRouteName' => NULL,
   '_routingInfo' => 
  array (
  ),
   '_route' => 'adminhtml',
   '_directFrontNames' => 
  array (
    'api' => '',
  ),
   '_controllerModule' => 'Mage_Adminhtml',
   '_isStraight' => false,
   '_beforeForwardInfo' => 
  array (
  ),
   '_internallyForwarded' => true,
))

alexh-swdev avatar Nov 19 '23 14:11 alexh-swdev

I got exactly the same problem. Login works but this error message shows up twice every time.

codephunk avatar Mar 20 '24 12:03 codephunk

Same here :( image

ioweb-gr avatar Apr 05 '24 11:04 ioweb-gr