Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 2
Customer login problem
 
jibrailkhan
Jr. Member
 
Total Posts:  1
Joined:  2013-10-18
 

My customers were not able to login in front end . However i did have access to admin panel. I tried every single trick and tip available . nothing worked .
I had an old backup of “app” and “ “downloader” folder.
First i made copy of current folders , then i replaced these two folders with my old backup folders which i had.

During this process , i set 503 Service unavailable for front end .
If you don’t know how to do 503 , simply rename your index.php for few minutes .
make sure you either delete or rename already existing “app” and “downloader” folders.

once you have finished replacing , Don’t forget to clear files in var/cache and var/session .

and in the end correct your file name for index.php(Only if you changed it).

It worked for me .
I spent two days , couldn’t find any other way of solving this issue . I contacted my hosting provider for support , although they are nice people but They were horrible in their tech support,

Rum Pum
Jibrail Khan.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Carles Tubio
Jr. Member
 
Avatar
Total Posts:  3
Joined:  2012-04-25
Barcelona, Catalonia
 
track-23 - 02 January 2013 09:09 AM

I was having problems where after certain customers (not all) tried logging in with their correct credentials they would get returned to the login page without being logged in and with no error message being displayed. I tried the cookie domain “fix” and the session validation settings “fix” both mentioned in this thread, but none of that helped. Finally I was able to find this: http://www.novusweb.com/1340/e-commerce-technology/fix-for-passing-magento-session-ids/ and everything has seemed to work smashingly since. (It’s been almost a week.)

In case the link disappears here’s a summary of the code changes:

Duplicate the file app/code/core/Mage/Customer/Model/session.php to app/code/local/Mage/Customer/Model/session.php so your changes don’t get overwritten when upgrading. Then (on line 216 in Magento CE 1.7.0.2) change the following:

public function login($username$password)
    
{
        
/** @var $customer Mage_Customer_Model_Customer */
        
$customer Mage::getModel('customer/customer')
            ->
setWebsiteId(Mage::app()->getStore()->getWebsiteId());

        if (
$customer->authenticate($username$password)) {
            $this
->setCustomerAsLoggedIn($customer);
            
$this->renewSession();
            return 
true;
        
}
        
return false;
    
}

to

public function login($username$password)
    
{
        
/** @var $customer Mage_Customer_Model_Customer */
        
$customer Mage::getModel('customer/customer')
            ->
setWebsiteId(Mage::app()->getStore()->getWebsiteId());

        if (
$customer->authenticate($username$password)) {
            $this
->setCustomerAsLoggedIn($customer);
            
// $this->renewSession(); // Commented out to fix customer login loop
            
return true;
        
}
        
return false;
    
}

All you’re doing is commenting out
$this->renewSession();
so that the customer’s session is not renewed upon logging in.

I haven’t received any reports so far that it has resulted in any unforeseen related issues. For a full rundown go here: http://www.novusweb.com/1340/e-commerce-technology/fix-for-passing-magento-session-ids/

I hope that helps someone else. And thank you, Bret Williams of Novusweb!

thank you! i integrated CakePHP with Magento (dont ask me why xDD [crazy customers]) and your solution fixed all my session glitches.
thank you again!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Rennes007
Jr. Member
 
Total Posts:  19
Joined:  2011-10-19
 

Hi all,

i’ve been having the same issue. Some users could log in, some others couldn’t.

I had to empty the cart of the user that wasn’t working (customers > manage customers > edit the user and remove all items in their cart).

I’ve also updated cookie settings (system > configuration > make sure you are in the default config scope > web > Session cookie management)

cookie lifetime: 3600
cookie path: leave empty
cookie domain: yourdomain.com (not www in front)
Use http only: yes
cookie restriction mode: no

That’s what worked for me.

Using Magento 1.8.0.0

 
Magento Community Magento Community
Magento Community
Magento Community
 
akizor88
Jr. Member
 
Total Posts:  6
Joined:  2011-08-17
 

Hello,

Another situation that could cause the customer login issue is the missing form_key from login template.

In order to solve this please locate the login.phtml template in your theme
Go to template/customer/form/login.phtml and template/persistent/customer/form/login.phtml and add the following code in the login form

<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />

More info on this post

Regards,
Daniel Placinta

 
Magento Community Magento Community
Magento Community
Magento Community
 
agolder89
Jr. Member
 
Total Posts:  2
Joined:  2014-01-06
 

This fixed my issue! Customers were not able to login and no error messages were given for my custom theme. Added the code below before the ending </form> tag and all is well. Thank you!

akizor88 - 13 January 2014 11:51 PM

Hello,

Another situation that could cause the customer login issue is the missing form_key from login template.

In order to solve this please locate the login.phtml template in your theme
Go to template/customer/form/login.phtml and template/persistent/customer/form/login.phtml and add the following code in the login form

<input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" />

More info on this post

Regards,
Daniel Placinta
 
Magento Community Magento Community
Magento Community
Magento Community
 
webworksbd
Jr. Member
 
Total Posts:  2
Joined:  2012-01-19
 

Please go to this path and open login.phtml

app/design/frontend/default/yourtheme/template/persistent/customer/form/login.phtml

find :  <?php echo $this->getBlockHtml('formkey'); ?>

If not found then add after this line:
<form action="<?php echo $this->getPostActionUrl() ?>” method="post" id="login-form">

so final view will be

<form action="<?php echo $this->getPostActionUrl() ?>” method="post" id="login-form">
<?php echo $this->getBlockHtml('formkey'); ?>

Thanks
Mahmud

 
Magento Community Magento Community
Magento Community
Magento Community
 
SebsMagento
Jr. Member
 
Total Posts:  2
Joined:  2013-11-12
 
webworksbd - 26 February 2014 08:27 PM

Please go to this path and open login.phtml

app/design/frontend/default/yourtheme/template/persistent/customer/form/login.phtml

find :  <?php echo $this->getBlockHtml('formkey'); ?>

If not found then add after this line:
<form action="<?php echo $this->getPostActionUrl() ?>” method="post" id="login-form">

so final view will be

<form action="<?php echo $this->getPostActionUrl() ?>” method="post" id="login-form">
<?php echo $this->getBlockHtml('formkey'); ?>

Thanks
Mahmud

This worked for me CE 1.8.1 ultimo theme, thank you Mahmud

 
Magento Community Magento Community
Magento Community
Magento Community
 
skamasknight
Jr. Member
 
Total Posts:  3
Joined:  2014-04-14
 

I use

1 – Go to template/customer/form/login.phtml and template/persistent/customer/form/login.phtml and under

1
<ul class=\"form-list\">
add the following code in the login form

1
<input type=\"hidden\" name=\"form_key\" value=\"<?php echo Mage::getSingleton(\'core/session\')->getFormKey(); ?>\” />

also modify

Please go to this path and open login.phtml

app/design/frontend/default/yourtheme/template/persistent/customer/form/login.phtml

find :  <?php echo $this->getBlockHtml(\'formkey\'); ?>

If not found then add after this line:
<form action=\"<?php echo $this->getPostActionUrl() ?>” method=\"post\" id=\"login-form\">

so final view will be

<form action=\"<?php echo $this->getPostActionUrl() ?>” method=\"post\" id=\"login-form\">
<?php echo $this->getBlockHtml(\'formkey\'); ?>

by webworksbd

finally in

system > configuration > make sure you are in the default config scope > web > Session cookie management)

cookie lifetime: 3600
cookie path: leave empty
cookie domain: yourdomain.com (not www in front, not dot in front)
Use http only: yes
cookie restriction mode: no
by Rennes007

in cookie domain no www and not dot (.) in front

and work :D thanks to everybody

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 2