summaryrefslogtreecommitdiff
path: root/app/helpers/cookies_helper.rb
blob: 3a7e99871900e2f7fbcbb3de26a195042fe853cb (plain)
1
2
3
4
5
6
7
8
9
# frozen_string_literal: true

module CookiesHelper
  def set_secure_cookie(key, value, httponly: false, permanent: false)
    cookie_jar = permanent ? cookies.permanent : cookies

    cookie_jar[key] = { value: value, secure: Gitlab.config.gitlab.https, httponly: httponly }
  end
end