Sha256: 011e0d84a53852dabe019a32458709b8ebaf2a60cd5d65d640082f19028a095e

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

# vim:fileencoding=utf-8

unless defined?(Rack::Session::Abstract::ENV_SESSION_OPTIONS_KEY)
  module Rack
    module Session
      module Abstract
        ENV_SESSION_OPTIONS_KEY = 'rack.session.options'.freeze
      end
    end
  end
end

unless defined?(ActionDispatch::Session::AbstractStore)
  module ActionDispatch
    module Session
      class AbstractStore
        ENV_SESSION_OPTIONS_KEY = 'rack.session.options'.freeze
        DEFAULT_OPTIONS = {
          key: '_session_id',
          path: '/',
          domain: nil,
          expire_after: nil,
          secure: false,
          httponly: true,
          cookie_only: true
        }.freeze

        def initialize(app, options = {})
          @app = app
          @default_options = DEFAULT_OPTIONS.dup.merge(options)
          @key = @default_options[:key]
          @cookie_only = @default_options[:cookie_only]
        end

        private

        def generate_sid
          rand(999..9999).to_s(16)
        end
      end
    end
  end
end

unless defined?(Rails)
  require 'logger'

  module Rails
    def self.logger
      @logger ||= Logger.new('/dev/null')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
redis-session-store-0.8.1 spec/support.rb