Class Maveric::Sessions
In: maveric/sessions.rb
Parent: Set

Contains session data and provides conveniance in generating an appropriate cookie.

Methods

session  

Classes and Modules

Class Maveric::Sessions::Session

Constants

COOKIE_NAME = 'SESSIONID'

Public Instance methods

[Source]

    # File maveric/sessions.rb, line 8
 8:     def session id #wants stringed hex num
 9:       #ensure crusty old sessions don't linger
10:       @__i += 1 rescue @__i = 1
11:       reject!{|s| s.expire < Time.now-3 } if (@__i%=10) == 0
12:       # now get the session
13:       session = find{|s| s.id == id } and return session
14:       #there isn't one? then make a new one!
15:       push Session.new and return last
16:     end

[Validate]