Class: Rack::Session::Mongo::Session

Inherits:
Object
  • Object
show all
Includes:
MongoMapper::Document
Defined in:
lib/mongo-rack-session.rb

Instance Method Summary collapse

Instance Method Details

#is_valid?Boolean

Returns:

  • (Boolean)


18
19
20
21
22
23
24
# File 'lib/mongo-rack-session.rb', line 18

def is_valid?
  if self.Timeout && self.StartTimestamp 
    (self.StartTimestamp + (self.Timeout/1000).seconds > Time.now) ? self : nil
  else
    nil
  end
end