Greasy Fork is available in English.

議論 » 開発

Access all Cookies for Site (http and https)

§
投稿日: 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

§
投稿日: 2014/07/04

That's what HttpOnly does.

§
投稿日: 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.

返信を投稿

返信を投稿するにはログインしてください。