Class: Mack::RunnerHelpers::Session
- Defined in:
- lib/mack/testing/helpers.rb,
lib/mack/runner_helpers/session.rb
Instance Attribute Summary collapse
-
#sess_id ⇒ Object
Returns the value of attribute sess_id.
Instance Method Summary collapse
Instance Attribute Details
#sess_id ⇒ Object
Returns the value of attribute sess_id.
6 7 8 |
# File 'lib/mack/runner_helpers/session.rb', line 6 def sess_id @sess_id end |
Instance Method Details
#complete(request, response, cookies) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/mack/runner_helpers/session.rb', line 25 def complete(request, response, ) if configatron.mack.use_sessions unless response.redirection? request.session.delete(:tell) end Mack::SessionStore.set(request.session.id, request, response, ) end end |
#start(request, response, cookies) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mack/runner_helpers/session.rb', line 8 def start(request, response, ) if configatron.mack.use_sessions self.sess_id = retrieve_session_id(request, response, ) unless self.sess_id self.sess_id = create_new_session(request, response, ) else sess = Mack::SessionStore.get(self.sess_id, request, response, ) if sess request.session = sess else # we couldn't find it in the store, so we need to create it: self.sess_id = create_new_session(request, response, ) end end end end |