Some explain about beforeAuthUrl and afterAuthUrl.

These two are session variable used in customer module to redirect to last visit page before login. This is my understanding.

But why magento use these two variable instead of one variable.

Could some one explain about these variables briefly.

I've refer this link but 'm not fully understand that. To get more information about this i've post this question here. Thanks to xyking for asking this question.


  • in your link answer is already there
    – Keyul Shah
    Commented Mar 8, 2014 at 11:16

2 Answers 2


AfterAuthUrl(): Set this when you want to redirect user after login to specific URL.

beforeAuthUrl():set this if you want the customer to redirect to particuler page after registration.. including you can also redirect customer to login page so that he/she can do login after registration.

Reason for using this 2 seperate variable is clear in above sentence.


The other answer is correct about afterAuthUrl, i.e., it is where the customer is redirected upon logging in. However beforeAuthUrl is where the user is redirected if the login attempt fails, e.g., with a wrong password. This is the case for the variables in the 'customer/session' singleton.

  • If this is true, then I cant understand why it calls before auth url in _welcomeCustomer in the customer account controller.
    – DWils
    Commented Oct 13, 2016 at 3:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.