Skip to content

Commit c2bae9a

Browse files
committed
feat(ssr): enables deletion logic for server cookies
Deletion uses the cookie setter with a past date in the expiration options. Now that the setter is updated to support server cookies as well, this will work for both client and server cookies.
1 parent 5cd884d commit c2bae9a

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

projects/ngx-cookie-service-ssr/src/lib/ssr-cookie.service.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,6 @@ export class SsrCookieService {
366366
* @since: 1.0.0
367367
*/
368368
delete(name: string, path?: string, domain?: string, secure?: boolean, sameSite: 'Lax' | 'None' | 'Strict' = 'Lax'): void {
369-
if (!this.documentIsAccessible) {
370-
return;
371-
}
372369
const expiresDate = new Date('Thu, 01 Jan 1970 00:00:01 GMT');
373370
this.set(name, '', { expires: expiresDate, path, domain, secure, sameSite });
374371
}
@@ -385,10 +382,6 @@ export class SsrCookieService {
385382
* @since: 1.0.0
386383
*/
387384
deleteAll(path?: string, domain?: string, secure?: boolean, sameSite: 'Lax' | 'None' | 'Strict' = 'Lax'): void {
388-
if (!this.documentIsAccessible) {
389-
return;
390-
}
391-
392385
const cookies: any = this.getAll();
393386

394387
for (const cookieName in cookies) {

0 commit comments

Comments
 (0)