Redirect user to the page they wanted after login I have some pages that require login from the user. What I'd like is for the user to get redirected to the page that they wanted after they've logged in rather than sent to the page that they were on before they attempted to view a 'login required' page.

At present I have this in my login form:

&lt;input type="hidden" name="redirect" value="{{ craft.request.getUrlReferrer }}"&gt;


Is there a craft request method I can use instead of getUrlReferrer to accomplish this?
If you are using {% requireLogin %} tags, then the Craft UserSession service has a getReturnUrl() method which should give you what you want. It is accessible in your templates via craft.session.returnUrl. Here is a link to the docs. Hope this helps!