Class: Rack::Session::Abstract::ID
- Defined in:
- lib/rack/session/abstract/id.rb
Direct Known Subclasses
Constant Summary
Constants inherited from Persisted
Instance Attribute Summary
Attributes inherited from Persisted
#default_options, #key, #sid_secure
Class Method Summary collapse
Instance Method Summary collapse
-
#delete_session(req, sid, options) ⇒ Object
All thread safety and session destroy procedures should occur here.
-
#find_session(req, sid) ⇒ Object
All thread safety and session retrieval procedures should occur here.
-
#write_session(req, sid, session, options) ⇒ Object
All thread safety and session storage procedures should occur here.
Methods inherited from Persisted
#call, #commit_session, #context, #initialize
Constructor Details
This class inherits a constructor from Rack::Session::Abstract::Persisted
Class Method Details
.inherited(klass) ⇒ Object
410 411 412 413 414 415 416 417 |
# File 'lib/rack/session/abstract/id.rb', line 410 def self.inherited(klass) k = klass.ancestors.find { |kl| kl.respond_to?(:superclass) && kl.superclass == ID } unless k.instance_variable_defined?(:"@_rack_warned") warn "#{klass} is inheriting from #{ID}. Inheriting from #{ID} is deprecated, please inherit from #{Persisted} instead" if $VERBOSE k.instance_variable_set(:"@_rack_warned", true) end super end |
Instance Method Details
#delete_session(req, sid, options) ⇒ Object
All thread safety and session destroy procedures should occur here. Should return a new session id or nil if options
439 440 441 |
# File 'lib/rack/session/abstract/id.rb', line 439 def delete_session(req, sid, ) destroy_session req.env, sid, end |
#find_session(req, sid) ⇒ Object
All thread safety and session retrieval procedures should occur here. Should return [session_id, session]. If nil is provided as the session id, generation of a new valid id should occur within.
424 425 426 |
# File 'lib/rack/session/abstract/id.rb', line 424 def find_session(req, sid) get_session req.env, sid end |
#write_session(req, sid, session, options) ⇒ Object
All thread safety and session storage procedures should occur here. Must return the session id if the session was saved successfully, or false if the session could not be saved.
432 433 434 |
# File 'lib/rack/session/abstract/id.rb', line 432 def write_session(req, sid, session, ) set_session req.env, sid, session, end |