123456789_123456789_123456789_123456789_123456789_

Class: ActionController::RequestForgeryProtection::ProtectionMethods::NullSession

Relationships & Source Files
Inherits: Object
Defined in: actionpack/lib/action_controller/metal/request_forgery_protection.rb

Class Method Summary

Instance Method Summary

Constructor Details

.new(controller) ⇒ NullSession

[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/request_forgery_protection.rb', line 235

def initialize(controller)
  @controller = controller
end

Instance Method Details

#handle_unverified_request

This is the method that defines the application behavior when a request is found to be unverified.

[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/request_forgery_protection.rb', line 240

def handle_unverified_request
  request = @controller.request
  request.session = NullSessionHash.new(request)
  request.flash = nil
  request.session_options = { skip: true }
  request.cookie_jar = NullCookieJar.build(request, {})
end