{"id":13378,"date":"2011-12-21T03:36:44","date_gmt":"2011-12-21T08:36:44","guid":{"rendered":"http:\/\/info.template-help.com\/?p=13378"},"modified":"2016-02-23T05:23:38","modified_gmt":"2016-02-23T10:23:38","slug":"magento-cant-login-to-admin-panel","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/magento-cant-login-to-admin-panel.html","title":{"rendered":"Magento. Can&#8217;t login to admin panel"},"content":{"rendered":"<p>\r\n<p>This tutorial shows how to resolve the Magento admin panel login issue. <\/p>\r\n<p><!--more--><\/p>\r\n<p>It&#8217;s a common issue: you are trying to login to the Magento admin panel, typed your username and password, clicked Login button and nothing happens. The page refreshes and that&#8217;s all. No error or any other messages. <\/p>\r\n<p><a href=\"http:\/\/info.template-help.com\/wp-content\/uploads\/2011\/12\/magento-cant-login-1.jpg\"><img loading=\"lazy\" src=\"http:\/\/info.template-help.com\/wp-content\/uploads\/2011\/12\/magento-cant-login-1-300x108.jpg\" alt=\"\" title=\"magento-cant-login-1\" width=\"300\" height=\"108\" class=\"aligncenter size-medium wp-image-13379\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/12\/magento-cant-login-1-300x108.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2011\/12\/magento-cant-login-1.jpg 586w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\r\n<p>This is caused by the cookies issue. In some cases Magento can&#8217;t store them. Let&#8217;s see how the issue can be resolved. <\/p>\r\n<h3>Using localhost (WAMP, XAMP, AppServ etc)<\/h3>\r\n<p>If you are running Magento on local server using the specific server applications (listed above) try to replace <strong>&#8216;localhost&#8217;<\/strong> in the website URL with <strong>&#8216;127.0.0.1&#8217;<\/strong>. In other words link to the Magento admin panel login page will be <strong>&#8216;127.0.0.1\/magento\/admin&#8217;<\/strong><\/p>\r\n<p>If this doesn&#8217;t help please proceed to other solutions <\/p>\r\n<h3>Edit Varien.php file<\/h3>\r\n<p>Open Magento installation directory and go to the <strong>&#8216;app\\code\\core\\Mage\\Core\\Model\\Session\\Abstract&#8217;<\/strong> folder. There open <strong>&#8216;Varien.php&#8217;<\/strong> file with your editor (Adobe Dreamweaver, Notepad ++ etc). <\/p>\r\n<p>Depending on your version of Magento the code can be different so I&#8217;ll show you several cases. <\/p>\r\n<h4>Magento 1.4.x<\/h4>\r\n<p>In the Varien.php file locate the code:<\/p>\r\n<pre class=\"brush:php\">\r\n if (!$cookieParams['httponly']) {\r\n  unset($cookieParams['httponly']);\r\n  if (!$cookieParams['secure']) {\r\n  unset($cookieParams['secure']);\r\n  if (!$cookieParams['domain']) {\r\n  unset($cookieParams['domain']);\r\n  }\r\n  }\r\n  }\r\n  \r\nif (isset($cookieParams['domain'])) {\r\n  $cookieParams['domain'] = $cookie-&gt;getDomain();\r\n  }\r\n<\/pre>\r\n<p>And comment it. Type \/* before the code and *\/ after. Or just replace it with the code below:<\/p>\r\n<pre class=\"brush:php\">\r\n \/*if (!$cookieParams['httponly']) {\r\n  unset($cookieParams['httponly']);\r\n  if (!$cookieParams['secure']) {\r\n  unset($cookieParams['secure']);\r\n  if (!$cookieParams['domain']) {\r\n  unset($cookieParams['domain']);\r\n  }\r\n  }\r\n  }\r\n  \r\nif (isset($cookieParams['domain'])) {\r\n  $cookieParams['domain'] = $cookie-&gt;getDomain();\r\n  }*\/\r\n<\/pre>\r\n<h4>Magento 1.5.x and Magento 1.6.x<\/h4>\r\n<p>In the Varien.php file locate the code:<\/p>\r\n<pre class=\"brush:php\">\r\n    $cookieParams = array(            \r\n        'lifetime' =&gt; $cookie-&gt;getLifetime(),            \r\n        'path'     =&gt; $cookie-&gt;getPath(),            \r\n        'domain'   =&gt; $cookie-&gt;getConfigDomain(),            \r\n        'secure'   =&gt; $cookie-&gt;isSecure(),            \r\n        'httponly' =&gt; $cookie-&gt;getHttponly()        \r\n    );\r\n<\/pre>\r\n<p>and replace with <\/p>\r\n<pre class=\"brush:php\">\r\n    $cookieParams = array(            \r\n        'lifetime' =&gt; $cookie-&gt;getLifetime(),            \r\n        'path'     =&gt; $cookie-&gt;getPath(),            \r\n        \/\/'domain'   =&gt; $cookie-&gt;getConfigDomain(),            \r\n        \/\/'secure'   =&gt; $cookie-&gt;isSecure(),            \r\n        \/\/'httponly' =&gt; $cookie-&gt;getHttponly()        \r\n    );\r\n<\/pre>\r\n<p>Then comment the code:<\/p>\r\n<pre class=\"brush:php\">\r\n if (!$cookieParams['httponly']) {\r\n  unset($cookieParams['httponly']);\r\n  if (!$cookieParams['secure']) {\r\n  unset($cookieParams['secure']);\r\n  if (!$cookieParams['domain']) {\r\n  unset($cookieParams['domain']);\r\n  }\r\n  }\r\n  }\r\n  \r\nif (isset($cookieParams['domain'])) {\r\n  $cookieParams['domain'] = $cookie-&gt;getDomain();\r\n  }\r\n<\/pre>\r\n<p>the same way as for the Magento 1.4.x (please check above)<\/p>\r\n<p> <\/p>\r\n<p><!--more--> <\/p>\r\n<p><!--more--> <\/p>\r\n<p><!--more--><\/p>","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to resolve the Magento admin panel login issue.<\/p>\n","protected":false},"author":2,"featured_media":13380,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[729],"tags":[582,808,2407,1489],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/13378"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=13378"}],"version-history":[{"count":0,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/13378\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/13380"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=13378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=13378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=13378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}