Take the 2-minute tour ×
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

I have installed magento 1.9. It was working well for a week. Suddenly yesterday, when I try to login to the Magento admin panel, I typed username and password, clicked Login button and nothing happens. The page refreshes and that’s all. No error or any other messages.

If I entered wrong username or password, It shows error.

After I googled about this issue, I was recommented to comment following lines in app\code\core\Mage\Core\Model\Session\Abstract\Varien.php

/* to solve login issue */
  /*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();*/ //I have commented these lines

And for some older versions below was recommented in the same file.

$cookieParams = array(           
    'lifetime' => $cookie->getLifetime(),           
    'path'     => $cookie->getPath(),           
    //'domain'   => $cookie->getConfigDomain()           
    //'secure'   => $cookie->isSecure(),           
    //'httponly' => $cookie->getHttponly()       
);
  }*/

Even after that, I could not login into admin. It is as it was. Anyone faced this issue? Is any other solution to this issue.

(I tried clearing cache and session through ftp).

share|improve this question
    
could you please clear the browser cache/cookie and try again? –  alamelu Jul 5 at 18:21

3 Answers 3

up vote 7 down vote accepted

Stop modifying the core code like that — it may temporarily solve an issue, but it may create future issues that will be almost impossible to track down.

There's a number of different issues that cause the errorless admin login behavior you're seeing, but they all go back to Magento not being able to set or read the session cookie. Magneto uses sessions to pass error messages between pages — that's why you don't see an error message. Magento also uses sessions to store the "is logged in" value, so not setting sessions also causes the core error behavior.

Possible causes include

  • Local computer time vs. server time mismatch, causing instant cookie invalidation. Make sure your server time is correct.

  • Incorrect permissions on var/session, preventing session files from being saved

  • Incorrect configuration of database/redis/other session storage, preventing saving of session values

  • A module is instantiating sessions to early, preventing the correct session names from being set

  • You're a developer using multiple URLs and have multiple cookie domains

  • Another developer has somehow modified app\code\core\Mage\Core\Model\Session\Abstract\Varien.php, creating a hard to track down bug

  • The cookie domain in System -> Configuration -> Web -> Session Cookie Management doesn't match the actual site domain.

  • You're using the localhost as your server domain, and using a version of webkit that has trouble/bugs setting cookies for localhost in some situations.

The short term fix is to just delete your cookie for the domain. That's often enough to solve the problem. If it persists, figure out which of the above reasons is the reason for your error, and take steps to address it (fix permissions, etc.)

share|improve this answer
2  
You can use n98-magerun's sys:check command to find problems with cookie domain and base url. magerun.net/quick-tip-find-login-issues-with-syscheck-command –  cmuench Jul 5 at 18:57
    
@Alan Storm, Thank you for the clear explanation. I solved my issue. In my case, reason of issue is 3rd one. –  SIBHI S Jul 12 at 10:45

I'm having the same symptoms on some Magento installations(not only 1.9). In my case, it happens only in Chrome. I'm fixing this by logging in Firefox/Safari/Opera, and changing 'Use HTTP only' to 'No' in 'Session Cookies Management' of the 'Web' settings. See Magento's backend screenshot with cookies settings

share|improve this answer
    
Thanks, this really helped me –  ryeballar Aug 10 at 10:17

I had the same problem and I solved it by deleting all files in /var/session . I think it's because too many session in Magento!

share|improve this answer
    
This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. –  Keyul Shah Aug 18 at 10:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.