i18n icon indicating copy to clipboard operation
i18n copied to clipboard

How to enable cookies through nuxt middleware?

Open wrz199306 opened this issue 3 years ago • 2 comments

Due to the limitation of GDPR, cookies cannot be enabled for all users.

But I can know whether the user is allowed through other cookies

So I want to enable cookies dynamically, For example, nuxt middleware.

Is there any way?

Thanks

wrz199306 avatar Oct 10 '22 14:10 wrz199306

You can disable the cookie (detectBrowserLanguage.useCookie) but I'm not sure how this will affect the detectBrowserLanguage logic. Would need to check the code. You could potentially implement custom logic to store that cookie when needed, after disabling that option.

That said, even with GDPR you should be able to treat this cookie as "essential" and not have to avoid setting it.

rchl avatar Oct 10 '22 15:10 rchl

When the detectBrowserLanguage. useCookie is set to false, thesetLocaleCookie is invalid. Actively set i18n_ Redirected cookies and redirects do not work.

wrz199306 avatar Oct 13 '22 03:10 wrz199306

That said, even with GDPR you should be able to treat this cookie as "essential" and not have to avoid setting it.

Exactly. Functional cookies are exempted from needing to be disabled because of GDPR.

jpsc avatar Apr 15 '23 10:04 jpsc

Yes, given the above, I don't see the need to do address this.

rchl avatar Apr 17 '23 09:04 rchl