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

Fatal error on setRedirectWithCookieCheck
 
Bench_uk
Jr. Member
 
Total Posts:  16
Joined:  2011-11-09
 

I’ve upgraded to 1.8 from 1.6 and all has been very smooth - except one annoying issue.

Any link that requires a login check is failing with the below error IF the user is not logged in:

Fatal error: Call to undefined method Mage_Customer_AccountController::setRedirectWithCookieCheck() in /home/bestavde/public_html/app/code/core/Mage/Customer/Model/Session.php on line 276

If the user is logged in, the customer is redirected correctly to the right page. So for example the ‘My Account’ link in the header returns this error if the user is not logged in as opposed to directing them to to the log in page as it should do. If the user is logged in, they go to the my account page.

This worked fine before the upgrade, and I’m stumped as to where this issue is coming from. I’ve tried reverting to the default design for Magento 1.8 ‘out of the box’ and the issue persists so I can only imagine its either a bug in 1.8 OR (more likely) some setting I need to make in 1.8 thats different to 1.6

Any help please?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bench_uk
Jr. Member
 
Total Posts:  16
Joined:  2011-11-09
 

Ok a little more on this. This function is failing:

public function authenticate(Mage_Core_Controller_Varien_Action $action$loginUrl null)
    
{
        
if ($this->isLoggedIn()) {
            
return true;
        
}

        $this
->setBeforeAuthUrl(Mage::getUrl('*/*/*', array('_current' => true)));
        if (isset(
$loginUrl)) {
            $action
->getResponse()->setRedirect($loginUrl);
        
else {
           
/* $action->setRedirectWithCookieCheck(Mage_Customer_Helper_Data::ROUTE_ACCOUNT_LOGIN,
                Mage::helper('customer')->getLoginUrlParams()
            );*/
        
}

        
return false;
    
}

The specific bit that’s failing is the bit I’ve commented out. This now returns a blank page instead of erroring. So - it’s checking to see if they are logged in, and then it’s checking to see if the $loginURL has been set. If both are no (which in this case appears to be what’s happening) it is then running the setRedirectWithCookieCheck function which is where it is falling over.

So - now I’m lost. I can force a redirect I guess to get around this but it doesn’t solve the underlying issue of why this is failing in the first place. Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bench_uk
Jr. Member
 
Total Posts:  16
Joined:  2011-11-09
 

Nasty fix as it bypasses what this actually should be doing (although I have no idea what it is doing!)

$action->getResponse()->setRedirect(’/customer/account/login/’);

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