title: rails authenticate_or_request_with_http_basic
body: <p>in my RoR application i need to protect a page with basic authentication and i want that the credentials are asked every time that a user link to that page.</p>
  
  <p>so i added a filter before the operation, like this:</p>
  
  <pre><code>before_filter :request_confirm, :only =&gt; [:delete_device]
  </code></pre>
  
  <p>and the filter method is:</p>
  
  <pre><code>def request_confirm
  
    user = User.find_by_id(session[:user_id])
  
    authenticate_or_request_with_http_basic do |nick, pass| 
     nick == user.nickname and pass == user.password 
    end
  
  end
  </code></pre>
  
  <p>it's ok, but only the first time because rails save inserted data, so the following times the filter will be execute but the credential won't ask.</p>
  
  <p>I don't know where credential are saved.
  . </p>