Module: Warden::Mixins::Common

Included in:
Proxy, Strategies::Base
Defined in:
lib/warden/mixins/common.rb

Instance Method Summary collapse

Instance Method Details

#paramsObject

Convenience method to access the rack request params :api: public



32
33
34
# File 'lib/warden/mixins/common.rb', line 32

def params
  request.params
end

#requestObject

Convenience method to access the rack request. :api: public



18
19
20
# File 'lib/warden/mixins/common.rb', line 18

def request
  @request ||= Rack::Request.new(@env)
end

#reset_session!Object

Resets the session. By using this non-hash like sessions can be cleared by overwriting this method in a plugin



39
40
41
# File 'lib/warden/mixins/common.rb', line 39

def reset_session!
  raw_session.clear
end

#sessionObject Also known as: raw_session

Convenience method to access the session :api: public



9
10
11
# File 'lib/warden/mixins/common.rb', line 9

def session
  env['rack.session']
end

#warden_cookiesObject

Provides a warden repository for cookies. Those are sent to the client when the response is streamed back from the app. :api: public



25
26
27
28
# File 'lib/warden/mixins/common.rb', line 25

def warden_cookies
  warn "warden_cookies was never functional and is going to be removed in next versions"
  env['warden.cookies'] ||= {}
end