Magento Forum

Can’t login to admin after installation. 
 
Sophia10
Jr. Member
 
Total Posts:  9
Joined:  2010-02-15
 

Newly installed 1.4.0.1, the front page shows the normal demo, but the admin page shows “404 error: Page not found.” Installed twice and both time got the same error. Tried Vivekananthan’s method of commenting Varien.php file, but with no success.

Help please.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Alexis Alulema
Jr. Member
 
Total Posts:  1
Joined:  2010-03-05
 

Hey all you guys. I found something interesting. I was facing the same problem and changing “localhost” by “127.0.0.1” resolved the problem in part, i mean, sometimes “localhost” appeared without explanation.

I saw the message “{{base_url}} is not recommended to use in a production environment to declare the Base Unsecure Url / Base Secure Url. It is highly recommended to change this value in your Magento configuration” and it capted my attention. When I tried to change it to “http://127.0.0.1” my Magento exploded hahaha.

Well, I had to reinstall my entire Magento, but starting from

http://127.0.0.1/magento

And everything is working without any problems. If you have just installed it using localhost instead of 127.0.0.1 you can correct it by going to System>Configuration>Web>Unsecure>Base URL, change the value to: http://127.0.0.1/magento/, and it can save you some headaches.

Hope this helps u. Regards

 
Magento Community Magento Community
Magento Community
Magento Community
 
eistern82
Jr. Member
 
Total Posts:  2
Joined:  2010-03-11
 

Even change the localhost to 127.0.0.1 also cannot go to admin login page.

Any one know the advance solution???

Even I did this step below also cannot work :

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…);

p/s: I am thinking to use this method(link below) , but not understand. Somebody can make it simple explain please. Thanks You
http://magentoexpert.blogspot.com/2009/11/fixing-magento-login-problem-after.html

 
Magento Community Magento Community
Magento Community
Magento Community
 
s26125
Jr. Member
 
Total Posts:  1
Joined:  2010-03-23
 

I had the same login-problem but there is a simple way to fix it without messing around with any hostname stuff or something like that.
The key is as some others mentioned before the \\app\\code\\core\\Mage\\Core\\Model\\Session\\Varien.php file. You may tweak it, the way Vivekananthan explained (http://www.magentocommerce.com/boards/viewreply/214632/) or simply change the start()-method\’s $cookieParams so that $cookieParams[’secure’] = false and $cookieParams[’httponly’] = false (I\’m not even sure, if the later is necessary) (ll. 82, 83 in Magento 1.4.0).

Referring to a posting (http://www.magentocommerce.com/boards/viewreply/220324/) in this thread concerning this error message in the admin-panel „{{base_url}} is not recommended to use in a production environment to declare the Base Unsecure Url / Base Secure Url. It is highly recommended to change this value in your Magento configuration“:
It\’s not necessary to reinstall magento. Simply go to the „Web“-Configuration-Tab and change both the unsecure as well as the secure Base URL to „http://127.0.0.1“ (make sure to provide the path to the magento-dir; on my local server it was for instance „127.0.0.1/magento“) (since „localhost“ won\’t be accepted as a domain name).

 
Magento Community Magento Community
Magento Community
Magento Community
 
Netz
Jr. Member
 
Total Posts:  10
Joined:  2010-03-23
 

Hi,.
Great info ... I read it all and have same problem…
I get errors when and if I mess with the Varien.php file :(

So I read some of the links… And I realized that my mistake has been that I picked “W Eastern Europe Berlin” since Denmark/Copenhagen was NOT listen in the Timezone dropdown (How can you miss a Major City like (Hopen-hagen) ?? Anyway smile

How Do I edit my cookies (it expire before it can be set...) I tried to set my timezone by clicking on the TIME in lower right side of Windows XP
I should mention that my install is NOT local… It’s on my server and all vent well until I logged out :(

Is there a way to edit the DB via PhpMyadmin ?? Or can I find the cookie and edit that?
I tried logging in with all browsers… All fail :(
Crome, Ie8 and Firefox…

I sure hope Copenhagen can come back in the list? and there are someone with a nice helping hand/trick smile

God bless

“Netz”

 
Magento Community Magento Community
Magento Community
Magento Community
 
Netz
Jr. Member
 
Total Posts:  10
Joined:  2010-03-23
 

HI,

I opened the DB and edited the Europe/Berlin to Europe/Copenhagen
No change… Still can’t login… :-(

Anyone?

I would love to start using my new shop… first time (15 hours ago) I was recommended the software… but been locked out for 13 hours

 
Magento Community Magento Community
Magento Community
Magento Community
 
laurabinos
Jr. Member
 
Total Posts:  2
Joined:  2010-03-21
 

This solution is for magento-1.4.0.1:

- Go to magentodir/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php

- and comment just line 100 like this

// call_user_func_array(’session_set_cookie_params’, $cookieParams);

It will work after that!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Netz
Jr. Member
 
Total Posts:  10
Joined:  2010-03-23
 

Hi laurabinos,

Thanks mate - You are my HERO!!!
I am back inside my admin section.... Now the fun begins!!

Magic line 100

 
Magento Community Magento Community
Magento Community
Magento Community
 
jeremysawesome
Jr. Member
 
Avatar
Total Posts:  11
Joined:  2010-02-01
 

What I did to get it work.

1. Add a new host to my hosts file (How to change the hosts file)

127.0.0.1 my.projects

Now you should be able to access anything on your localhost with my.projects. Example: http://my,projects/magento = http://localhost/magento

**If you are going to do a fresh install then you can use “http://my.projects/” instead of “http://localhost” and everything should work fine and you don’t have to continue.

2. Replace the instances of “localhost” with “my.projects” in the Magento database. I used mysqldump to get a dump of the db.

mysqldump --host localhost magento_db magento_db.sql
Then I did a find and replace on the SQL file. I dropped the current Magento database, created a new one of the same name, and imported the changed SQL.

3. Delete the var/cache and var/session folders from your Magento folder.

Now you should successfully be able to access your Magento site with the “my.projects” name (or any name of your choosing). This worked for me and I am able to login successfully without any problems. I did not have to worry about the Base_URL settings or worry about changing Magento code.

 
Magento Community Magento Community
Magento Community
Magento Community
 
blablabla
Jr. Member
 
Total Posts:  1
Joined:  2010-05-12
 
Vivekananthan - 19 February 2010 01:45 AM

If its magento 1.4 then go to the following file:
app/code/core/Mage/Core/Model/Session/Abstract/Varien.php

On Line no: 78

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

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

Change it to:

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

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

That’s it, it would work smile
Let me know if you have any problems on that.

Yeah Yeah!!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
willemaster
Jr. Member
 
Total Posts:  1
Joined:  2010-05-13
 
jdesign - 29 September 2009 02:34 AM

sushi - 31 August 2009 04:38 AM
johnh - 29 May 2009 11:49 PM
-Go to app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file within your magento directory.

-Find the code,

session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath(),
$this->getCookie()->getDomain(),
$this->getCookie()->isSecure(),
$this->getCookie()->getHttponly()
);

-Replace above code by,

session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()
//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly()
);

-Save it and try to login to your magento admin panel.


if u only comment the lines instead of replacing text take a good look at commas !!!!!

This worked. Thanks a LOT man. I can’t thank you enough. This has just saved me a hosting I’d have bought just to try out Magento since I wasn’t able to try it using WAMP on Windows 7.

Yeah this worked for me too. Thanks heaps! grin

Thanks for this. The code in my version of this file was slightly different. I got it to work using the following comments:
// session cookie params
$cookieParams = array(
‘lifetime’ => $cookie->getLifetime(),
‘path’ => $cookie->getPath()
//’domain’ => $cookie->getConfigDomain(),
//’secure’ => $cookie->isSecure(),
//’httponly’ => $cookie->getHttponly()
);

// if (!$cookieParams[’httponly’]) {
// unset($cookieParams[’httponly’]);
// if (!$cookieParams[’secure’]) {
// unset($cookieParams[’secure’]);
// if (!$cookieParams[’domain’]) {
// unset($cookieParams[’domain’]);
// }
// }
// }

 
Magento Community Magento Community
Magento Community
Magento Community
 
Profinvent
Jr. Member
 
Total Posts:  1
Joined:  2010-06-02
 

This works for me. Great solution, thanks

Vivekananthan - 19 February 2010 01:45 AM

If its magento 1.4 then go to the following file:
app/code/core/Mage/Core/Model/Session/Abstract/Varien.php

On Line no: 78

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

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

Change it to:

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

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

That’s it, it would work smile
Let me know if you have any problems on that.
 
Magento Community Magento Community
Magento Community
Magento Community
 
camilo sanchez
Jr. Member
 
Total Posts:  13
Joined:  2008-11-21
Dominican Republic
 

I had the same problem you guys have and the only thing that worked fine for me without compromising magento’s code (which is the most recommended way to do things) was that thing @jeremysawesome just recommended. i just modified the hosts file in C:\Windows\System32\drivers\etc and put a domain in 127.0.0.1. This worked like a charm! Thanks jeremy!

 
Magento Community Magento Community
Magento Community
Magento Community
 
RepriseMusicGroup
Jr. Member
 
Total Posts:  20
Joined:  2009-04-08
 

Hi there

Have tried a few of these fixes but non are working.

Gettting the following message when trying to login into admin

Fatal error: Function __autoload(Mage_Admin_Model_Acl) threw an exception of type \’Exception\’ in /home/reprise/stores.reprisemusicgroup.com/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 123

it\’s definitely something to do with the problems everyone in this thread has been having - any ideas?!

 
Magento Community Magento Community
Magento Community
Magento Community
 
etou
Jr. Member
 
Total Posts:  6
Joined:  2010-05-03
 

It doesn’t work…

When I write http://127.0.0.1/magento/index.php/admin, it automaticly redirect me to http://localhost/magento -_-

Is there any other solution to this problem?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top