title: Redirected to http://localhost:3000/session/new
body: <p>So I have a rails app 2.x app that works fine via the web, but when trying to perform a POST I keep getting "Redirected to <a href="http://localhost:3000/session/new" rel="nofollow">http://localhost:3000/session/new</a> Filter chain halted as [:require_user] rendered_or_redirected.". In my iPhone app, I can create a new session and sign-in via my iPhone app, but cannot POST to say the POSTS_Controller.</p>
  
  <p>I have this in my code </p>
  
  <pre><code>Posts_Controller
  
  before_filter :require_user, :only =&gt; [:create, :update, :destroy]
  
  
  Application_Controller
  # Filters added to this controller apply to all controllers in the application.
  # Likewise, all the methods added will be available for all controllers.
  
  class ApplicationController &lt; ActionController::Base 
    include AuthenticatedSystem
    include Geokit::Geocoders
  
    helper :all # include all helpers, all the time
    #session :session_key =&gt; '_cwa_session_id' 
  
  
    #filter_parameter_logging :password
  
    # See ActionController::RequestForgeryProtection for details
    # Uncomment the :secret if you're not using the cookie session store
    protect_from_forgery # :secret =&gt; 'eejj7eded74769099999944a729b4f'     
  
    #filter_parameter_logging(:password)
  
    before_filter :login_from_cookie
    before_filter :find_user_interests 
    before_filter :find_user_posts
  
   protected         
    def find_user_interests
      @user_interests = cur_user ? cur_user.interesting_posts : [] 
      logger.debug "User interests hash: #{current_user.inspect}"
    end          
  
    def find_user_posts
      @user_posts = cur_user ? cur_user.posts : []
    end     
  
    def cur_user
       User.find(session[:user_id]) if session[:user_id]  
    end
  
    def require_user
      unless cur_user
        flash[:error] = "You must be logged in to do that."
        redirect_to '/session/new'
        return false
      end
    end
  
    geocode_ip_address
  
    def geokit
      @location = session[:geo_location]
    end
  
  end
  </code></pre>
  
  <p>I have been working on this for 2 months and cannot figure out the issue.  In my iPhone app I am using ObjectiveResource. I am sending over json and have "Mime::Type.register_alias "application/json", :json" set up on the rails side.</p>