Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?


share|improve this question
up vote 6 down vote accepted

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 }}">
share|improve this answer
Awesome. That works perfectly. Thanks! – Travis Gertz Sep 4 '14 at 0:19
I can't get this to work. I really don't understand. – Tom De Smet Nov 18 '14 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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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