1

I tried to fake forgery request in my rails 3.0.8 app with no success

I have regular form and I changed the auth key with Tamper before submit it at this point I would expect rails to reset the session and therefor signout the current_user however it didn't happen, the action completed successfully and the user stay signed in

I have the protect_from_forgery statement in my application controller and I tried to change config.consider_all_requests_local to false

gilsilas
  • 1,441
  • 2
  • 15
  • 24

1 Answers1

6

Indeed... it does something but you have to code it.

The previous behavior was removed, it's a controversial decision but you can get it back including the following code in your ApplicationController:

def handle_unverified_request
  #add here code to empty the session
  raise ActionController::InvalidAuthenticityToken
end
apneadiving
  • 114,565
  • 26
  • 219
  • 213