Sha256: 9ff629f72e6561e41bc2393a18f887bbe7d40a022bbda08ab882497c89bb5101

Contents?: true

Size: 618 Bytes

Versions: 1

Compression:

Stored size: 618 Bytes

Contents

require "cookieless_sessions/version"

module CookielessSessions
  module EnabledController
    extend ActiveSupport::Concern

  protected

    def default_url_options
      options = super.dup || {} # super.dup is very important here!

      if session_id.present?
        options[session_key] = session_id
      end

      return options
    end

    def session_key
      Rails.application.config.session_options[:key]
    end

    def session_id
      request.session_options[:id]
    end

    def session_is_not_cookie_only?
      Rails.application.config.session_options[:cookie_only] == false
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cookieless_sessions-1.0.0 lib/cookieless_sessions.rb