# Login pre-filter and post data problems

**URL:** <https://www.ruby-forum.com/t/login-pre-filter-and-post-data-problems/107144>\
**Category:** Rails\
**Created:** [June 18, 2007, 4:15pm UTC](https://www.ruby-forum.com/t/login-pre-filter-and-post-data-problems/107144 "2007-06-18T16:15:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spacen\_Jasset](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e274bd/32.png) [@Spacen\_Jasset](https://www.ruby-forum.com/u/Spacen_Jasset)\
**Post date:** [June 18, 2007, 4:15pm UTC](https://www.ruby-forum.com/t/login-pre-filter-and-post-data-problems/107144/1 "2007-06-18T16:15:14Z")

</div>

Hello Folks,

I am trying to use a standard sort of login controller, whereby you  
put a pre-filter on the pages on which you want the user to have to  
login. This is all well an good, except for one thing. Here is some  
code to save the original request uri before redirecting to the logon  
page.

def authorize  
…  
session[:original\_uri] = request.request\_uri  
logger.info(“ApplicationController: request\_uri  
#{request.request\_uri}”)  
…  
end

Unfortunatly one of my pages has a form on it with a single “action”  
type button. Hence it’s a post request, and since it’s a post request  
it appears that the post data is lost when login redirect happens.  
i.e. the line above to save the original\_uri isn’t sufficient. How  
might I remedy this?

Regards,

Spacen
