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 Admin login problem

Magento Admin login problem

December 24, 2014July 7, 2009 by Mukesh Chapagain
Categories Magento Tags admin, administrator, login, Magento
FacebookTweetLinkedInPinPrintEmailShares

Problem:

I had a new installation of magento. But I was unable to login as an administrator. I went to the admin login page, entered correct username and password but was redirected to the same login page. I could not enter the dashboard page. Error message is displayed when I enter wrong username or password. But nothing is displayed and I am redirected to the same login page when I insert correct username and password.

Solution:

Modify Magento code. Open app/code/core/Mage/Core/Model/Session/Abstract/Varien.php. Comment out the
lines 80 to 83. The line number may vary according to the Magento version. These lines are present somewhere near line 80. You have to comment the comma (,) in line:

$this->getCookie()->getPath()//,

NOTE: Editing Core File is NOT a good practice. It is better to make a local copy of core file. Copy app/code/core/Mage/Core/Model/Session/Abstract/Varien.php to app/code/local/Mage/Core/Model/Session/Abstract/Varien.php and edit the local file.


// set session cookie params
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()//,
//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly()
);

Update (For Magento 1.4.*) and higher versions

In Magento 1.4 and higher versions, you have to comment code below which is present around line 80 to 100 in

app/code/core/Mage/Core/Model/Session/Abstract/Varien.php.


/*  if (!$cookieParams['httponly']) {
	unset($cookieParams['httponly']);
	if (!$cookieParams['secure']) {
		unset($cookieParams['secure']);
		if (!$cookieParams['domain']) {
			unset($cookieParams['domain']);
		}
	}
} 

if (isset($cookieParams['domain'])) {
	$cookieParams['domain'] = $cookie->getDomain();
} */

NOTE: Editing Core File is NOT a good practice. It is better to make a local copy of core file. Copy app/code/core/Mage/Core/Model/Session/Abstract/Varien.php to app/code/local/Mage/Core/Model/Session/Abstract/Varien.php and edit the local file.

This might be a quick fix. However, it is better to find out the exact cause of your problem and then try fixing it. There can be different reasons behind this problem of admin login. Here is a proper answer to this issue: http://magento.stackexchange.com/a/26083/1883

Hope it helps.
Thanks.

Related posts:

  1. Magento: Solution to “Error: 404 Not Found” in Admin Login Page
  2. Magento 2: Increase Admin Login Session Lifetime
  3. Magento: Redirect Customer to Previous Page After Login
  4. Joomla: Admin login problem [Solution]
Categories Magento Tags admin, administrator, login, Magento
How to Install Sample Data for Magento?
JoomlaPack – Simply the best backup component for Joomla!

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,655 views
  • LaTeX: Generate dummy text (lorem ipsum) in your document - 228,049 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,655 views
  • LaTeX: Generate dummy text (lorem ipsum) in your document - 228,049 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