Greasy Fork is available in English.

Discussions » Development

Access all Cookies for Site (http and https)

§
Posted: 2014.07.04.

Access all Cookies for Site (http and https)

Trying to access all cookies for google.com but I am unable to access HttpOnly cookie (NID).

Below is the code:

var cookies = document.cookie.split(';');
for (var i = 0 ; i < cookies.length; i++)
{
    console.log(cookies[i]);
}

And I go to the site: https://www.google.com/webhp?hl=en

What I expect is a list of either 2 or 3 cookies (IDs PREF, OGPC and NID), however the NID cookie, which is marked as http only, is never listed. How can I access the NID cookie in js?

I want to be able to delete NID and OGPC cookies and alter the PREF cookie.

thanks

§
Posted: 2014.07.04.

I figured that out.

How does the original document manage to access bother NID and PREF?

I was wandering if there is a way to access the NID cookie that is set to httpOnly? I am looking for a way to access the http cookie when through https document.

Post reply

Sign in to post a reply.