I just freshly installed Magento(1.7.0.2) on my localhost(LAMP). Now after installation when I wanted to go for the admin panel it asked me for the username and
If you are having trouble to get logged in with the correct username and password, here are some ideas. If you have used google chrome to install magento, use firefox to open magento and edit the app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file within your magento directory and comment those below lines
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath()
// 'domain' => $cookie->getConfigDomain(),
// 'secure' => $cookie->isSecure(),
// 'httponly' => $cookie->getHttponly()
);
And use your credentials to log in. I hope this works for you!!!
This issue also occurs when the disk quota is exceeded on the server and presumably the session info can not be written to disk if file-based cookie storage is used.
It's not right way to comment cookie params cause in future it will be push on server and make many problems. I know this from personal experience.
The best solution is rename the local url into a form more or less has the appearance of a typical url, having at least a point in a row. As example: http://yoursitename.local
**As mentioned by james. This method worked for me. This is a better option rather than changing the code. It worked for me for 127.0.0.1 as well as localhost and after deleting app/etc/local.xml. Delete the browser cookies. Run in your browser the installation of magento
localhost/magento/index.php.install.htm
and set your username & password again. Login to your admin panel. I didn't have to delete the database of magento so my data was safe.****
It's working for me.. Please follow below instruction
Goto System->Configuration->Web->Session Cookie Management
change the option 'Use HTTP only' to 'No'
If you are suffering to get logged in with the correct username and password. replace the code with the New code
Original code:-
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath(),
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()
);
New Code:-
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath()
/*,
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly() */
);
File Path :-app/code/core/Mage/Core/Model/Session/Abstract/Varien.php