<p>Craft 2.2 introduced the <a href="http://buildwithcraft.com/docs/config-settings#postLoginRedirect" rel="nofollow">postLoginRedirect</a> 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.</p>

CC BY-SA 3.0
2014-09-03T22:52:56.577Z
2014-09-03T22:52:56.577Z
Brad Bell
<p>As Brad said the new default behavior is for users to be redirected wherever <a href="http://buildwithcraft.com/docs/config-settings#postLoginRedirect">postLoginRedirect</a> is set to (if a <code>redirect</code> param was not in the POST data).</p>

<p>You can get your old behavior back by adding that hidden <code>redirect</code> param though, set to <a href="http://buildwithcraft.com/docs/templating/craft.request#getPath">craft.request.getPath()</a>:</p>

<pre class="lang-twig prettyprint-override"><code>&lt;input type="hidden" name="redirect" value="{{ craft.request.path }}"&gt;
</code></pre>

CC BY-SA 3.0
2014-11-18T19:21:32.477Z
I can't get this to work. I really don't understand.
Tom De Smet
CC BY-SA 3.0
2014-09-03T23:58:18.137Z
2014-09-04T11:18:11.613Z
2014-09-04T11:18:11.613Z
Brandon Kelly
<p>Since updating to Craft 2.2, my front-end login form now redirects to the home page.</p>

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

<p>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?</p>

<p>Thanks!</p>

<redirect>
Login redirects to home page after 2.2 update
# Login redirects to home page after 2.2 update

(Asked by: username_0 on 2014-09-03)

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!

**Tags:** redirect


---

## 2 answers

### Answer by username_2 on 2014-09-03. Score: 11 | Accepted answer

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():

> **Comments:**
> **username_3**: I can't get this to work. I really don't understand.  

---

### Answer by username_1 on 2014-09-03. Score: 4

Craft 2.2 introduced the [postLoginRedirect](http://buildwithcraft.com/docs/config-settings#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.


---

