Since updating to Craft 2.2, my front-end login form now redirects to the home page.

The intended behaviour is to just reload the page that the visitor was on when they logged in.

In Craft 2.1 I achieved this by omitting the hidden redirect field. Any idea how to prevent members from being kicked to the home page now?


2 Answers 2


As Brad said the new default behavior is for users to be redirected wherever postLoginRedirect is set to (if a redirect param was not in the POST data).

You can get your old behavior back by adding that hidden redirect param though, set to craft.request.getPath():

<input type="hidden" name="redirect" value="{{ craft.request.path }}">
  • I can't get this to work. I really don't understand. Commented Nov 18, 2014 at 19:21

Craft 2.2 introduced the postLoginRedirect config setting which affects not only where users on the front-end of the site get redirected to after logging in (defaults to the home page), but where they get sent if they visit the front-end login page while they are logged in.

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.