# Taken from RailsWarden, thanks to Hassox. http://github.com/hassox/rails_warden module Warden::Mixins::Common # Gets the rails request object by default if it's available def request return @request if @request if env['action_controller.rescue.request'] @request = env['action_controller.rescue.request'] else Rack::Request.new(env) end end def raw_session request.session end def reset_session! raw_session.inspect # why do I have to inspect it to get it to clear? raw_session.clear end # Proxy to request cookies def cookies request.cookies end end