Take the 2-minute tour ×
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It's 100% free, no registration required.

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?

Thanks!

share|improve this question

2 Answers 2

up vote 5 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 at 0:19
    
I can't get this to work. I really don't understand. –  Tom De Smet Nov 18 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

 
discard

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.