instance method
form_authenticity_token
Ruby on Rails 2.3.18
Since v2.2.3Signature
form_authenticity_token()
Sets the token value for the current session. Pass a :secret option in protect_from_forgery to add a custom salt to the hash.
Source
# File actionpack/lib/action_controller/request_forgery_protection.rb, line 108
def form_authenticity_token
session[:_csrf_token] ||= ActiveSupport::SecureRandom.base64(32)
end
Defined in actionpack/lib/action_controller/request_forgery_protection.rb line 108
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::RequestForgeryProtection