question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Delete not working

See original GitHub issue

Expected Behavior

    this.cookieService.set('Test', 'Hello World');
    console.log(this.cookieService.getAll());
    this.cookieService.delete('Test');
    this.cookieService.delete('Test', '/');
    this.cookieService.delete('Test', '/', 'localhost');
    console.log(console.log(this.cookieService.getAll()));
{Test: "Hello World"}
{}

cookie is deleted

Actual Behavior

    this.cookieService.set('Test', 'Hello World');
    console.log(this.cookieService.getAll());
    this.cookieService.delete('Test');
    this.cookieService.delete('Test', '/');
    this.cookieService.delete('Test', '/', 'localhost');
    console.log(console.log(this.cookieService.getAll())); 
{Test: "Hello World"}
{Test: "Hello World"}

cookie is not deleted

Steps to Reproduce the Problem

Specifications

  • Version: 3.0.2
  • Browser: chrome

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:18 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
webcourse-ngcommented, Jun 3, 2020

Work around: instead of trying to delete the cookie, set it again with an expired date. That’s how delete is coded to work - it just gets applied to the wrong domain when in a subdomain.

set('panda_cookie', '', new Date('Thu, 01 Jan 1970 00:00:01 GMT'), '/', 'domain', true, 'None')

3reactions
mymo689commented, Oct 3, 2021

I have the delete method not working issue happening for me as well, running cookie-service 12.0.3 with Angular 12.1.3. Seems to be completely random, I can’t find a common denominator for steps to reproduce reliably.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Fixed] Delete Key Not Working in Windows 10 [Partition Magic]
Fix 1: Run the Windows Troubleshooter · Fix 2: Update, Roll Back or Uninstall the Keyboard Driver · Fix 3: Uninstall the Recently...
Read more >
Delete key not working - Microsoft Community
Check which Updates were installed at Settings > Update & Security > Windows Update > Installed Update History and try uninstalling any from ......
Read more >
Delete button on keyboard working, but not deleting - Dell
However when I press shift and DEL button,, it works,,, so to if I press CTRL ALT+DEL to get into Task Mgr.
Read more >
[SOLVED] - Delete Key not working - Tom's Hardware Forum
Hi, My Delete key is not working, I'm on latest version of Windows 10, tried external keyboard & On-screen keyboard delete keys, ...
Read more >
Delete key is not working - Super User
To solve the problem, first plug out all USB devices, including small dongles and see if the problem goes away or not. If...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found