Posts Tagged ‘Magento’


Magento – Fix for admin login problem

Out of all CMS Magento installation is really big for everyone. Some time works and other time not works. Its all due to lake of common tips we missing while installation or After installation.

To make your mangeto admin panel working after installation follow below steps.

1] modify the core Magento code (keep in mind you may have to re-apply the fix if you update the code Magento code) – go to: app/code/core/Mage/Core/Model/Session/Abstract and open up varien.php, and comment out lines 73 (comment out the comma at the end of the line) through 76 so that it looks like the following:

// set session cookie params
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath() //remove this after putting on server (leave the comma)   ,
//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly()
);

For Latest version of magneto you have to do something new :)

In the latest version of which i’m using is 1.4.0.1
in that the below mentioned code is not available

app\code\core\Mage\Core\Model\Session\Abstract\varien.php

$this->getCookie()->getDomain(),
$this->getCookie()->isSecure(),
$this->getCookie()->getHttponly()

Comment these lines line (may be at line 78…);

search for “// session cookie params” line in app\code\core\Mage\Core\Model\Session\Abstract\varien.php

change

$cookieParams = array(
‘lifetime’ => $cookie->getLifetime(),
‘path’ => $cookie->getPath(),
‘domain’ => $cookie->getConfigDomain(),
‘cookieParams’ => $cookie->isSecure(),
‘httponly’ => $cookie->getHttponly()
);

to

$cookieParams = array(
‘lifetime’ => $cookie->getLifetime(),
‘path’ => $cookie->getPath()
);

and comment the below mentioned code
line number 86,

/* 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();
}
*/

now login as admin, it will work
Hope to get lots of thanks here :)

Magento installation problem in localhost – [validate-url] – Please enter a valid URL. Protocol is required…

Comment line no. #501 in \magento-1.4.2.0\js\prototype\validation.js file by code below:
like below i did

['validate-url', 'Please enter a valid URL. Protocol is required (http://, https:// or ftp://)', function (v) {
//return Validation.get('IsEmpty').test(v) || /^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i.test(v)
return true;
}],

it will works :)

source:stackoverflow.com
Hire Me
Follow Me!
Search
Most Popular Articles & Pages
Because your vote is Important
Sorry, there are no polls available at the moment.
Categories