Delete cookies in site information

Advertisements

I’m building a web app using Angular. I want to delete cookies, which is shown in site information

But these cookies are not showing in the developer console

I want to delete these cookies using JavaScript. But I can’t even access these cookies using document.cookie. How do I delete these cookies using JavaScript? Any solutions? Feel free to use Jquery or npm package.

>Solution :

What you are trying, removing cookies, might not be possible to do directly from the browser via JavaScript.

I cannot confirm from your pictures, but from your problem I deduce that the cookies that are not showing on the developer console or on document.cookie have the flag HttpOnly this attribute prevents the access to this cookies via JS, from MDN:

Use the HttpOnly attribute to prevent access to cookie values via JavaScript.

You can find more information about the topic and cookies in general in the MDN documentation.

Leave a ReplyCancel reply