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:
<input type="hidden" name="redirect" value="{{ craft.request.getUrlReferrer }}">
Is there a craft request method I can use instead of getUrlReferrer to accomplish this?