Module: Cookies

Extended by:
ActiveSupport::Concern
Included in:
ApplicationController
Defined in:
app/controllers/concerns/cookies.rb

Instance Method Summary (collapse)

Instance Method Details



4
5
6
7
# File 'app/controllers/concerns/cookies.rb', line 4

def digest_cookie(file, key)
  sha256 = Digest::SHA256.file(file)
  cookies[key] = sha256.hexdigest
end

Returns:

  • (Boolean)


9
10
11
12
# File 'app/controllers/concerns/cookies.rb', line 9

def digested_cookie_exists?(file, key)
  sha256 = Digest::SHA256.file(file)
  cookies[key] == sha256.hexdigest
end