Module: RackCAS::MongoidStore

Included in:
ActionDispatch::Session::RackCasMongoidStore, Rack::Session::RackCASMongoidStore
Defined in:
lib/rack-cas/session_store/mongoid.rb

Defined Under Namespace

Classes: Session

Class Method Summary collapse

Class Method Details

.destroy_session_by_cas_ticket(cas_ticket) ⇒ Object



18
19
20
21
# File 'lib/rack-cas/session_store/mongoid.rb', line 18

def self.destroy_session_by_cas_ticket(cas_ticket)
  affected = Session.where(cas_ticket: cas_ticket).delete
  affected == 1
end

.prune(after = nil) ⇒ Object



23
24
25
26
# File 'lib/rack-cas/session_store/mongoid.rb', line 23

def self.prune(after = nil)
  after ||= Time.now - 2592000 # 30 days ago
  Session.where(:updated_at.lte => after).delete
end