diff --git a/webapp/plugins/i18n.js b/webapp/plugins/i18n.js index 8c64ef0c3..44005db62 100644 --- a/webapp/plugins/i18n.js +++ b/webapp/plugins/i18n.js @@ -29,7 +29,13 @@ export default ({ app, req, cookie, store }) => { return } - app.$cookies.set(key, newLocale) + const expires = new Date() + expires.setDate(expires.getDate() + app.$env.COOKIE_EXPIRE_TIME) + app.$cookies.set(key, newLocale, { + expires, + // maxAge: app.$env.COOKIE_EXPIRE_TIME * 60 * 60 * 24, // days to seconds + sameSite: 'lax', + }) if (!app.$i18n.localeExists(newLocale)) { import(`~/locales/${newLocale}.json`).then((res) => { app.$i18n.add(newLocale, res.default)