Sha256: f1ed6910a1f1277e22e260345f0d0d953c4348451f01e98b746c999a5402948a

Contents?: true

Size: 737 Bytes

Versions: 21

Compression:

Stored size: 737 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

21 entries across 21 versions & 1 rubygems

Version Path
challah-1.6.1 lib/challah/cookie_store.rb
challah-1.6.0 lib/challah/cookie_store.rb
challah-1.5.0 lib/challah/cookie_store.rb
challah-1.4.2 lib/challah/cookie_store.rb
challah-1.4.1 lib/challah/cookie_store.rb
challah-1.4.0 lib/challah/cookie_store.rb
challah-1.3.3 lib/challah/cookie_store.rb
challah-1.3.2 lib/challah/cookie_store.rb
challah-1.3.1 lib/challah/cookie_store.rb
challah-1.3.0 lib/challah/cookie_store.rb
challah-1.2.11 lib/challah/cookie_store.rb
challah-1.2.10 lib/challah/cookie_store.rb
challah-1.2.9 lib/challah/cookie_store.rb
challah-1.2.8 lib/challah/cookie_store.rb
challah-1.2.7 lib/challah/cookie_store.rb
challah-1.2.6 lib/challah/cookie_store.rb
challah-1.2.5 lib/challah/cookie_store.rb
challah-1.2.5.pre lib/challah/cookie_store.rb
challah-1.2.4 lib/challah/cookie_store.rb
challah-1.2.3 lib/challah/cookie_store.rb