diff --git a/npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts b/npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts index fd550e1e73..82f0ac413a 100644 --- a/npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts +++ b/npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts @@ -129,18 +129,18 @@ export class AuthPasswordFlowStrategy extends AuthFlowStrategy { private setRememberMe(remember: boolean) { this.removeRememberMe(); localStorage.setItem(this.storageKey, 'true'); - document.cookie = `${this.cookieKey}=true${ - remember ? ';expires=Fri, 31 Dec 9999 23:59:59 GMT' : '' + document.cookie = `${this.cookieKey}=true; path=/${ + remember ? ' ;expires=Fri, 31 Dec 9999 23:59:59 GMT' : '' }`; } private removeRememberMe() { localStorage.removeItem(this.storageKey); - document.cookie = this.cookieKey + '= ; expires = Thu, 01 Jan 1970 00:00:00 GMT'; + document.cookie = this.cookieKey + '= ; path=/; expires = Thu, 01 Jan 1970 00:00:00 GMT'; } async init() { - if (!getCookieValueByName('rememberMe') && localStorage.getItem(this.storageKey)) { + if (!getCookieValueByName(this.cookieKey) && localStorage.getItem(this.storageKey)) { this.oAuthService.logOut(); }