mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Add expiration date and sameSite attribute to lacale cookie
This commit is contained in:
parent
c5dd01f744
commit
d491c1bad6
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user