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

  • Very Simple Add, Edit, Delete, View (CRUD) in PHP & MySQL [Beginner Tutorial] - 435,163 views
  • How to Calculate Inverter & Battery Backup Time? - 430,453 views
  • LaTeX: Generate dummy text (lorem ipsum) in your document - 238,159 views
  • GPG: Remove keys from your public keyring? - 203,599 views
  • Magento: How to get attribute name and value? - 189,659 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

  • Very Simple Add, Edit, Delete, View (CRUD) in PHP & MySQL [Beginner Tutorial] - 435,163 views
  • How to Calculate Inverter & Battery Backup Time? - 430,453 views
  • LaTeX: Generate dummy text (lorem ipsum) in your document - 238,159 views
  • GPG: Remove keys from your public keyring? - 203,599 views
  • Magento: How to get attribute name and value? - 189,659 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
© 2026 Mukesh Chapagain Blog
Manage Cookie Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}