Module: Immunio::CookieHooks

Extended by:
ActiveSupport::Concern
Defined in:
lib/immunio/plugins/action_dispatch.rb

Instance Method Summary collapse

Instance Method Details

#lookup_with_immunio(name) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/immunio/plugins/action_dispatch.rb', line 16

def lookup_with_immunio(name)
  Request.time "plugin", "#{Module.nesting[0]}::#{__method__}" do
    raw_cookie_value = @parent_jar[name]
    cookie_value = Request.pause "plugin", "#{Module.nesting[0]}::#{__method__}" do
      lookup_without_immunio(name)
    end
    if !raw_cookie_value.nil? and cookie_value.nil?
      Immunio.run_hook! "action_dispatch", "bad_cookie", key: name,
                                                         value: raw_cookie_value
    end
    cookie_value
  end
end