Skip to content

Mukesh Chapagain Blog

  • PHP
    • PHP
    • Laravel
    • WordPress
    • Joomla
  • Magento
    • Magento 2
    • Magento Extension
  • Node.js
    • Node.js
    • Javascript
    • jQuery
  • Database
    • MySQL
    • MongoDB
  • Data Science
    • Machine Learning
    • Recommender System
    • Natural Language Processing (NLP)
    • Sentiment Analysis
    • Python
    • R
  • Categories
    • Blockchain
      • Hyperledger Composer
      • Hyperledger-Fabric
    • Other
      • Cryptography
      • Data Structures & Algorithms
      • Git
      • LaTeX
      • Linux
      • Ubuntu
      • Xubuntu
      • Google
      • Google AppScript
  • About
    • About
    • Contact
    • Privacy Policy

Home » Magento » Magento 2 » Magento 2: Admin Login Error – Your current session has been expired

Magento 2: Admin Login Error – Your current session has been expired

October 5, 2018 by Mukesh Chapagain
Categories Magento, Magento 2 Tags admin, login, Magento, MySQL, problem, session
FacebookTweetLinkedInPinPrintEmailShares

Table of Contents

Toggle
  • Problem
  • Cause
  • Solution

Problem:

– I did a new installation of Magento 2.2.5.
– While installing it, I had disabled the third party modules installation.
– The installation was successful.
– Frontend opens fine.
– Backend opens fine.
– However, when I try to login to backend admin with the correct username and password, I get the following error:


Your current session has been expired.

Cause:

It was because of a missing entry of “session lifetime” in the database table core_config_data.

You can login to your Magento2 database and check for the path admin/security/session_lifetime in core_config_data table.

OR, you can also check the configuration settings value via command line with the following command:


php bin/magento config:show admin/security/session_lifetime

If there is an entry with the path admin/security/session_lifetime in the core_config_data table then the output will be the value of that path.

If there is no any entry with the path admin/security/session_lifetime in the core_config_data table then the output will be the following error message:


Configuration for path: "admin/security/session_lifetime" doesn't exist

Solution:

I added the “session lifetime” entry in the core_config_data table and then refreshed the Magento cache from the terminal and then I was able to login to admin.

What you have to do is, add the path admin/security/session_lifetime with value 86400 in the core_config_data table of your Magento2 database.


INSERT INTO `core_config_data` (`scope`, `scope_id`, `path`, `value`)
VALUES ('default', 0, 'admin/security/session_lifetime', '86400');

If you already have an entry in core_config_data table with path admin/security/session_lifetime then just try to increase the value of it to 86400.


UPDATE `core_config_data` 
SET `value` = 86400 
WHERE `path` = 'admin/security/session_lifetime';

OR, you can also directly set/update the configuration settings value via command line:


php bin/magento config:set admin/security/session_lifetime 86400

Refresh Magento Cache

– Open terminal
– Go to your magento installation root directory


cd /path/to/your/magento/folder

– Run the command to refresh cache


php bin/magento cache:clean

Hope this helps. Thanks.

Related posts:

  1. Magento 2: Increase Admin Login Session Lifetime
  2. Magento 2: Admin ERR_TOO_MANY_REDIRECTS
  3. Magento 2: Useful Configuration Settings & CLI Commands for Development Environment
  4. Magento 2: Disable Admin Password Expiration/Change
Categories Magento, Magento 2 Tags admin, login, Magento, MySQL, problem, session
Hyperledger Fabric/Composer: Error reading configuration: While parsing config: yaml: unknown anchor ‘OrdererDefaults’ referenced
Magento 2: Forbidden You don’t have permission to access /magento2/ on this server. Server unable to read htaccess file, denying access to be safe

About

Mukesh Chapagain Hi, I’m Mukesh Chapagain — a web developer, programmer, and tech enthusiast. Whether you're a beginner or an experienced developer, you’ll find tips, tutorials, and insights to help you navigate the ever-evolving world of technology. Happy coding! 🚀 about...

         

Subscribe via Email



Categories

Most Viewed

  • How to Calculate Inverter & Battery Backup Time? - 428,020 views
  • Very Simple Add, Edit, Delete, View (CRUD) in PHP & MySQL [Beginner Tutorial] - 415,646 views
  • LaTeX: Generate dummy text (lorem ipsum) in your document - 228,047 views
  • GPG: Remove keys from your public keyring? - 201,573 views
  • Magento: How to get attribute name and value? - 188,264 views

Recent Posts

  • Magento: The store that was requested wasn’t found. Verify the store and try again.
  • Magento2: Check Services version on Adobe Cloud Server
  • Magento 2 API: Add Products to Cart & Checkout Place Order
  • Magento 2 API: Create New Customer
  • Magento 2 API: Get Categories

Recent Posts

  • Magento: The store that was requested wasn’t found. Verify the store and try again.
  • Magento2: Check Services version on Adobe Cloud Server
  • Magento 2 API: Add Products to Cart & Checkout Place Order
  • Magento 2 API: Create New Customer
  • Magento 2 API: Get Categories

Most Viewed

  • How to Calculate Inverter & Battery Backup Time? - 428,020 views
  • Very Simple Add, Edit, Delete, View (CRUD) in PHP & MySQL [Beginner Tutorial] - 415,646 views
  • LaTeX: Generate dummy text (lorem ipsum) in your document - 228,047 views
  • GPG: Remove keys from your public keyring? - 201,573 views
  • Magento: How to get attribute name and value? - 188,264 views

Tag Cloud

admin Adobe Commerce api array attribute block category checkout CLI command line crud currency customer Database error extension git Google grid HTML image Javascript Joomla jQuery latex Linux login Magento magento2 magento 2 module MySQL natural language processing NLP nltk nodejs order PHP product python shopping cart template Ubuntu url Wordpress
© 2025 Mukesh Chapagain Blog
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkPrivacy policy