+ @session
+ end
+
+ # Below here is for pre-Rails 2.3.0 and not used in Rack-based servers
+ # The CGI::Session methods are a bit odd in that half are class and half
+ # are instance-based methods
+ # Note that +option+ is currently ignored as no options are recognized.
+ def initialize(session, options={})
+ # This is just some optimization since this is called over and over and over
+ if self.use_rack_session
+ super # MUST call super for Rack sessions
+ return true
+ elsif self.use_cgi_session
+ find_or_create_session(session.session_id)
+ else
+ version ||= Rails.version.split('.')
+ if version[0].to_i == 2 && version[1].to_i < 3
+ find_or_create_session(session.session_id)
+ self.use_cgi_session = true
+ else
+ super # MUST call super for Rack sessions
+ self.use_rack_session = true
+ end
+ end