Sha256: f46501f19d2c043fb068539a4f2f5113de245e0ccfc0d9bbafd9902268d60875

Contents?: true

Size: 937 Bytes

Versions: 4

Compression:

Stored size: 937 Bytes

Contents

Pakyow::Config.register :session do |config|
  # whether or not to use sessions
  config.opt :enabled, true

  # the session object
  config.opt :object, Rack::Session::Cookie

  # session middleware config options
  config.opt :options, -> {
    opts = {
      key: Pakyow::Config.session.key,
      secret: Pakyow::Config.session.secret
    }

    # set optional options if available
    %i(domain path expire_after old_secret).each do |opt|
      value = Pakyow::Config.session.send(opt)
      opts[opt] = value if value
    end

    opts
  }

  # the session key
  config.opt :key, -> { "#{Pakyow::Config.app.name}.session" }

  # the session secret
  config.opt :secret, -> { ENV['SESSION_SECRET'] }

  # the old session secret (used for rotation)
  config.opt :old_secret

  # session expiration, in seconds
  config.opt :expire_after

  # session cookie path
  config.opt :path

  # session cookie domain
  config.opt :domain
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pakyow-core-0.11.3 pakyow-core/lib/pakyow/core/config/session.rb
pakyow-core-0.11.2 pakyow-core/lib/pakyow/core/config/session.rb
pakyow-core-0.11.1 pakyow-core/lib/pakyow/core/config/session.rb
pakyow-core-0.11.0 pakyow-core/lib/pakyow/core/config/session.rb