class ActionController::RequestForgeryProtection::ProtectionMethods::NullSession - actionpack-4.2.3 Documentation

# class ActionController::RequestForgeryProtection::ProtectionMethods::NullSession

### Public Class Methods

new(controller) click to toggle source

    # File lib/action_controller/metal/request_forgery_protection.rb, line 120
    def initialize(controller)
      @controller = controller
    end

### Public Instance Methods

handle_unverified_request() click to toggle source

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

    # File lib/action_controller/metal/request_forgery_protection.rb, line 125
    def handle_unverified_request
      request = @controller.request
      request.session = NullSessionHash.new(request.env)
      request.env['action_dispatch.request.flash_hash'] = nil
      request.env['rack.session.options'] = { skip: true }
      request.env['action_dispatch.cookies'] = NullCookieJar.build(request)
    end