title: When does Devise store the location for stored_location_for_resource
body: <p>I was having problems redirecting to the last visited page when that page required a sign in <a href="https://stackoverflow.com/questions/13257269/devise-resetting-session-on-login">Devise Resetting Session On Login</a> and somebody pointed out that you could follow the code example here: <a href="https://github.com/plataformatec/devise/wiki/How-To%3A-redirect-to-a-specific-page-on-successful-sign-in" rel="nofollow noreferrer">https://github.com/plataformatec/devise/wiki/How-To%3A-redirect-to-a-specific-page-on-successful-sign-in</a></p>
  
  <p>That example calls <code>stored_location_for(resource)</code>...where is that set?</p>
  
  <p>That example works perfectly when used in conjunction with a <code>before_filter :authenticate_user!</code> in my appropriate controllers.  Looking at the source code for <code>authenticate_#{resource}!</code>, <a href="https://github.com/plataformatec/devise/blob/master/lib/devise/controllers/helpers.rb" rel="nofollow noreferrer">https://github.com/plataformatec/devise/blob/master/lib/devise/controllers/helpers.rb</a> it doesn't seem to save the location.</p>
  
  <p>Where in the world is the previous location stored?</p>