lib/roda/plugins/sessions.rb
# Persist the session data as a cookie.  If transparently upgrading from
# Rack::Session::Cookie, mark the related cookie for expiration so it isn't
# sent in the future.
Persist the session data as a cookie.  If transparently upgrading from
Rack::Session::Cookie, mark the related cookie for expiration so it isn't
sent in the future.
Persist the session data as a cookie . If transparently upgrading from Rack :: Session :: Cookie mark the related cookie for expiration so it isn ' t sent in the future .
def persist_session(headers, session)
          opts = roda_class.opts[:sessions]
          if session.empty?
            if env[SESSION_SERIALIZED]
              Rack::Utils.delete_cookie_header!(headers, opts[:key], opts[:remove_cookie_options])
            end
          elsif cookie_value = _serialize_session(session)
            cookie = Hash[opts[:cookie_options]]
            cookie[:value] = cookie_value
            cookie[:secure] = true if !cookie.has_key?(:secure) && ssl?
            Rack::Utils.set_cookie_header!(headers, opts[:key], cookie)
          end
          if env[SESSION_DELETE_RACK_COOKIE]
            Rack::Utils.delete_cookie_header!(headers, opts[:upgrade_from_rack_session_cookie_key], opts[:upgrade_from_rack_session_cookie_options])
          end
          nil
        end
def persist_session ( headers , session ) opts = roda_class . opts [ :sessions ] if session . empty? if env [ SESSION_SERIALIZED ] Rack :: Utils . delete_cookie_header! ( headers , opts [ :key ] , opts [ :remove_cookie_options ] ) end elsif cookie_value = _serialize_session ( session ) cookie = Hash [ opts [ :cookie_options ] ] cookie [ :value ] = cookie_value cookie [ :secure ] = true if ! cookie . has_key? ( :secure ) && ssl? Rack :: Utils . set_cookie_header! ( headers , opts [ :key ] , cookie ) end if env [ SESSION_DELETE_RACK_COOKIE ] Rack :: Utils . delete_cookie_header! ( headers , opts [ :upgrade_from_rack_session_cookie_key ] , opts [ :upgrade_from_rack_session_cookie_options ] ) end nil end
Persist the session data as a cookie.
Persist the session data as a cookie .
# If session was submitted and is now empty, remove the cookie # else # If no session was submitted, and the session is empty # then there is no need to do anything
headers
session