Sha256: 09aeb3812eb3d7153a0f2aeb821df6a6084e2336e945bbb5140f9a823d6b2652

Contents?: true

Size: 967 Bytes

Versions: 1

Compression:

Stored size: 967 Bytes

Contents

# vim:fileencoding=utf-8

unless defined?(ActionDispatch::Session::AbstractStore)
  module ActionDispatch # rubocop:disable Documentation
    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.4.0 spec/support.rb