diff options
| author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-01 21:12:02 +0000 |
|---|---|---|
| committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-01 21:12:02 +0000 |
| commit | 71722304bef22d1b162207e3e25e4109b0d0f8c1 (patch) | |
| tree | a80189974f400946831c047ca5d4f018b9bacccc /app/assets/javascripts/lib/utils/common_utils.js | |
| parent | 143a33345cf3607ad35ec31130cec4922bc1113c (diff) | |
| download | gitlab-ce-71722304bef22d1b162207e3e25e4109b0d0f8c1.tar.gz | |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/lib/utils/common_utils.js')
| -rw-r--r-- | app/assets/javascripts/lib/utils/common_utils.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js index eff00dff7a7..cf6ce2c4889 100644 --- a/app/assets/javascripts/lib/utils/common_utils.js +++ b/app/assets/javascripts/lib/utils/common_utils.js @@ -705,7 +705,10 @@ export const scopedLabelKey = ({ title = '' }) => { }; // Methods to set and get Cookie -export const setCookie = (name, value) => Cookies.set(name, value, { expires: 365 }); +export const setCookie = (name, value, attributes) => { + const defaults = { expires: 365, secure: Boolean(window.gon?.secure) }; + Cookies.set(name, value, { ...defaults, ...attributes }); +}; export const getCookie = (name) => Cookies.get(name); |
