Sha256: 2dc0883c6ed5549a3d49ccc98451041bf8720fe08e497ecd5471adc8ea14771e

Contents?: true

Size: 743 Bytes

Versions: 29

Compression:

Stored size: 743 Bytes

Contents

module Challah
  # Store session data in a cookie, but use the user's user_agent and ip address
  # in the cookie verification, for additional security.
  #
  # This method will force the user to log in slightly more often, as user agents
  # and IP addresses change.
  #
  # To use a different storage method for persisting a session, just create
  # a new class that responds to +read+, +save+ and +destroy+
  #
  class CookieStore < SimpleCookieStore
    def inspect
      "#<CookieStore:0x#{object_id.to_s(16)} valid=#{existing?}>"
    end

    protected
      def validation_cookie_value(value = nil)
        value = session_cookie_value unless value
        Encrypter.md5(value, request.user_agent, request.remote_ip)
      end
  end
end

Version data entries

29 entries across 28 versions & 2 rubygems

Version Path
challah-1.2.1 lib/challah/cookie_store.rb
challah-1.2.0 lib/challah/cookie_store.rb
challah-1.2.0.rc lib/challah/cookie_store.rb
challah-1.1.1 lib/challah/cookie_store.rb
challah-1.1.0 lib/challah/cookie_store.rb
challah-1.0.0 lib/challah/cookie_store.rb
challah-1.0.0.beta3 lib/challah/cookie_store.rb
challah-1.0.0.beta2 lib/challah/cookie_store.rb
challah-1.0.0.beta lib/challah/cookie_store.rb
challah-0.9.1.beta.3 lib/challah/cookie_store.rb
challah-0.9.1.beta.2 lib/challah/cookie_store.rb
challah-0.9.1.beta lib/challah/cookie_store.rb
challah-0.9.0 lib/challah/cookie_store.rb
challah-0.9.0.pre lib/challah/cookie_store.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/lib/challah/cookie_store.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/lib/challah/cookie_store.rb
challah-0.8.3 lib/challah/cookie_store.rb
challah-0.8.2 lib/challah/cookie_store.rb
challah-0.8.1 lib/challah/cookie_store.rb
challah-0.8.0 lib/challah/cookie_store.rb