Question

Fresh Install of Magento 2.2.2 on Centos (Plesk) with Apache 2.4, php 7.0.2 + all modules, mariaDb 10.1.

Magento Installation was done via browser wizard -> readyness check-> everything was ok. When I try to login to the Magento Admin Page "Your current session has been expired." is always showing.

I am running Magento 2.1.7 on this Server and had the same problem. But I solved this problem by changing one line of Timezone.php (shown in here https://github.com/magento/magento2/issues/5383). However with Magento 2.2.2 this solution does not work anymore.

Any Ideas how to solve this ?

Ps: Already cleared cache folders and cache via cli.

When I run "php -v" via SSH --> php 7.0.27 is shown

I configured Php 7 (via Plesk) for scripts on my domain "/opt/plesk/php/7.0/bin/php -v" --> shows php 7

BUT phpMyAdmin (login to mariaDB) shows this (php 5.6.30): enter image description here

Maybe this is causing the error ?

Was it helpful?

Solution

  • Find path admin/security/session_lifetime in core_config_data table
  • If it's present then set its value to 86400
  • If that path is not present then add it with value 86400
    INSERT INTO `core_config_data` (`scope`, `scope_id`, `path`, `value`)
    VALUES ('default', 0, 'admin/security/session_lifetime', '86400');

After that, refresh Magento cache:

php bin/magento cache:clean

OTHER TIPS

Try clearing your cache and login to admin.

rm -rf var/cache/*

rm -rf var/page_cache/*

php bin/magento cache:flush

I had enabled Magento Profiler before by adding 'SetEnv MAGE_PROFILER "html"' to my .htaccess. After removing this line again, the error stopped and I can access the admin page.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top