Class: CGI::Session

Inherits:
Object show all
Defined in:
lib/action_controller/cgi_ext/session.rb,
lib/action_controller/session/drb_store.rb,
lib/action_controller/session/active_record_store.rb

Overview

  • Expose the CGI instance to session stores.

  • Don’t require ‘digest/md5’ whenever a new session id is generated.

Defined Under Namespace

Classes: ActiveRecordStore, CookieStore, DRbStore, PStore

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cgi, options = {}) ⇒ Session

Returns a new instance of Session.



37
38
39
40
# File 'lib/action_controller/cgi_ext/session.rb', line 37

def initialize(cgi, options = {})
  @cgi = cgi
  initialize_without_cgi_reader(cgi, options)
end

Instance Attribute Details

#cgiObject (readonly)

Make the CGI instance available to session stores.



34
35
36
# File 'lib/action_controller/cgi_ext/session.rb', line 34

def cgi
  @cgi
end

#dataObject (readonly)

Returns the value of attribute data.



7
8
9
# File 'lib/action_controller/session/active_record_store.rb', line 7

def data
  @data
end

#dbmanObject (readonly)

Returns the value of attribute dbman.



35
36
37
# File 'lib/action_controller/cgi_ext/session.rb', line 35

def dbman
  @dbman
end

Instance Method Details

#initialize_without_cgi_readerObject



36
# File 'lib/action_controller/cgi_ext/session.rb', line 36

alias_method :initialize_without_cgi_reader, :initialize

#modelObject

Return this session’s underlying Session instance. Useful for the DB-backed session stores.



10
11
12
# File 'lib/action_controller/session/active_record_store.rb', line 10

def model
  @dbman.model if @dbman
end