Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javascript Chrome Extension Not able to read httponly cookies

I need to delete gmail cookies set in my chrome browser, using chrome extension , but it can delete all cookies other then Gmail cookies, then I noticed that Gmail cookies are httponly, Is there a way to remove them using javascript chrome extension..

Thanks :)

like image 817
Priyanka Avatar asked Jan 25 '16 13:01

Priyanka


People also ask

Can Chrome extensions see HttpOnly cookies?

Chrome extensions can use chrome. cookies API, that has access to all cookies in the cookie store, including httpOnly . The documentation for the API is here. Note that this API requires declaring a permission and will not work from content scripts.

Can JavaScript read HttpOnly cookie?

An HttpOnly cookie cannot be accessed by client-side APIs, such as JavaScript. This restriction eliminates the threat of cookie theft via cross-site scripting (XSS). If the browser allowed you to access it then it would be a defect in the browser.

Is HttpOnly cookie visible?

If the HttpOnly flag is included in the HTTP response header, the cookie cannot be accessed through the client-side script. As a result, even if a cross-site scripting (XSS) flaw exists, and a user accidentally accesses a link that exploits the flaw, the browser will not reveal the cookie to the third-party.

What is HttpOnly cookie JavaScript?

A cookie with the HttpOnly attribute is inaccessible to the JavaScript Document.cookie API; it's only sent to the server. For example, cookies that persist in server-side sessions don't need to be available to JavaScript and should have the HttpOnly attribute.


1 Answers

Chrome extensions can use chrome.cookies API, that has access to all cookies in the cookie store, including httpOnly.

The documentation for the API is here.

Note that this API requires declaring a permission and will not work from content scripts.

like image 189
Xan Avatar answered Oct 02 '22 09:10

Xan