2

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.

Cheers.

1
  • in your link answer is already there
    – Keyul Shah
    Mar 8 '14 at 11:16
6

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.

2

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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