Browse Source

Merge pull request #25859 from abpframework/issue/25858

Angular - Fixing the cookie language provider to set proper cookie path
pull/25869/head
oykuermann 1 month ago
committed by GitHub
parent
commit
e7c0b6d76a
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      npm/ng-packs/packages/core/src/lib/providers/cookie-language.provider.ts

2
npm/ng-packs/packages/core/src/lib/providers/cookie-language.provider.ts

@ -14,7 +14,7 @@ export function setLanguageToCookie() {
const cookieLanguageKey = injector.get(COOKIE_LANGUAGE_KEY); const cookieLanguageKey = injector.get(COOKIE_LANGUAGE_KEY);
sessionState.getLanguage$().subscribe(language => { sessionState.getLanguage$().subscribe(language => {
const cookieValue = encodeURIComponent(`c=${language}|uic=${language}`); const cookieValue = encodeURIComponent(`c=${language}|uic=${language}`);
document.cookie = `${cookieLanguageKey}=${cookieValue}`; document.cookie = `${cookieLanguageKey}=${cookieValue}; path=/`;
}); });
} }

Loading…
Cancel
Save