User Tools

Site Tools


developer_center:recipe_book:extensions_and_core:cookies

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developer_center:recipe_book:extensions_and_core:cookies [2013/12/28 08:27] (current)
geekshadow created
Line 1: Line 1:
 +====== Cookies ======
  
 +To create a new cookie, we can grab the cookie manager [[http://​www.xulplanet.com/​references/​xpcomref/​ifaces/​nsICookieManager2.html|nsiCookieManager2]] and use add():
 +
 +<​code>​var cookieManager = Components.classes["​@mozilla.org/​cookiemanager;​1"​].
 +            getService(Components.interfaces.nsICookieManager2);​
 +var d = new Date();
 +cookieManager.add("​.amazon.com",​ "/",​
 + "​dmusic_download_manager_enabled",​ "​on",​
 + false, false, false,
 + ((d.getTime()-d.getMilliseconds())/​1000) + 314496000);</​code>​
developer_center/recipe_book/extensions_and_core/cookies.txt ยท Last modified: 2013/12/28 08:27 by geekshadow