cancel
Showing results for 
Search instead for 
Did you mean: 

Redirecting to "My account" after login

Redirecting to "My account" after login

Hi Guys,

My page redirecting to "My Account" page after login, even setting "Redirect Customer to Account Dashboard after Logging" in to No (System->Configuration->Customers->Customer Configuration->login option). I have tried by clearing magento cache and browser cache, but still this issue exist. Please, Can anyone help me to find where this scenario is occurring.

 

Thanks,

5 REPLIES 5

Re: Redirecting to "My account" after login

Hello @Snehavaisha

 

Check hidden params value for that.

 

hidden params name is :- success_url

 

please check are you passing any value if then remove it and pass empty value.

 

Hope it will help you if works then mark as solution

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Redirecting to "My account" after login

Hi @Sunil Patel,

 

Thanks for your reply.

 

I have checked but there is no hidden values (success_url) passed using login form.

Re: Redirecting to "My account" after login

Have you solved this? I have the same issue.

Re: Redirecting to "My account" after login

Just change your password. Seems to be just an issue for mandatory changing password because it has no message to tell us. I got stuck 30 minutes on that page.

Re: Redirecting to "My account" after login

I know this is an old issue but on the off chance someone is googling it now. 

You have to pass referer in your action url.

Easiest way I found to do it is add 

$url  = $this->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true]);
$login_url = $block->getUrl('customer/account/loginPost', array('referer' => base64_encode($url)));

in your PHP and use $login_url as your action url like

action="<?= $escaper->escapeUrl($login_url) ?>"