Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Cookies

This article needs a technical review. How you can help.

This article needs an editorial review. How you can help.

This translation is incomplete. Please help translate this article from English.

Var olan Cookie'leri okuma

Cookies for a given host, represented as objects, can be enumerated as such:

let enum = Services.cookies.getCookiesFromHost("example.com");
while (enum.hasMoreElements()) {
  var cookie = e.getNext().QueryInterface(Ci.nsICookie2); 
  dump(cookie.host + ";" + cookie.name + "=" + cookie.value + "\n");
}

All cookies, regardless of host, can be enumerated using Services.cookies.enumerator rather than getCookiesFromHost().

The following code demonstrates how to set a cookie in Firefox.

Services.cookies.add(".host.example.com", "/cookie-path", "cookie_name", "cookie_value", is_secure, is_http_only, is_session, expiry_date);

Bunlara da bakın

Document Tags and Contributors

 Contributors to this page: pasalog
 Last updated by: pasalog,