2009-11-03 06:35:11 -05:00
|
|
|
module Warden::Mixins::Common
|
|
|
|
def request
|
2010-01-14 09:47:14 -05:00
|
|
|
@request ||= env['action_controller.rescue.request']
|
2009-11-03 06:35:11 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def reset_session!
|
|
|
|
raw_session.inspect # why do I have to inspect it to get it to clear?
|
|
|
|
raw_session.clear
|
|
|
|
end
|
|
|
|
|
2009-11-13 14:23:32 -05:00
|
|
|
def response
|
2010-01-14 09:47:14 -05:00
|
|
|
@response ||= env['action_controller.rescue.response']
|
2009-11-03 06:35:11 -05:00
|
|
|
end
|
|
|
|
end
|
2010-01-14 07:38:02 -05:00
|
|
|
|
|
|
|
class Warden::SessionSerializer
|
|
|
|
def serialize(record)
|
|
|
|
[record.class, record.id]
|
|
|
|
end
|
|
|
|
|
|
|
|
def deserialize(keys)
|
|
|
|
klass, id = keys
|
|
|
|
klass.find(:first, :conditions => { :id => id })
|
|
|
|
end
|
|
|
|
end
|