diff --git a/src/app/core/auth/auth.service.ts b/src/app/core/auth/auth.service.ts index 4a155920865..61c6900b31f 100644 --- a/src/app/core/auth/auth.service.ts +++ b/src/app/core/auth/auth.service.ts @@ -492,7 +492,12 @@ export class AuthService { // Set the cookie expire date const expires = new Date(expireDate); - const options: Cookies.CookieAttributes = { expires: expires }; + // Use Secure on HTTPS; Lax allows external-auth redirects via top-level GET navigation. + const options: Cookies.CookieAttributes = { + expires: expires, + secure: this._window.nativeWindow.location?.protocol === 'https:', + sameSite: 'lax', + }; // Save cookie with the token return this.storage.set(TOKENITEM, token, options);