User Tools

Site Tools


developer_center:recipe_book:extensions_and_core:cookies

Cookies

To create a new cookie, we can grab the cookie manager nsiCookieManager2 and use add():

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);
developer_center/recipe_book/extensions_and_core/cookies.txt · Last modified: 2013/12/28 08:27 by geekshadow