I'm right now creating an extension for firefox.I want to read a
cookie in the xul file . This cookie was previously created using
javascript in an html page.
When i use the same script in the xul file i cannot retrieve the
cookie. Is this possible??
I'm a newbie in creating extensions so please tell me a solution for
this problem or a tutorial where i could find answers for this
question,because i couldnot find the relevant details in firefox
forums.i used the following javascript functions for handling cookie.
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring
(nameEQ.length,c.length);
}
return null;
}
function eraseCookie(name) {
createCookie(name,"",-1);
}
This list is for usability and UI discussions.
(Sorry that I can't help :)
--
Alexander Limi · Firefox User Experience · http://limi.net
> _______________________________________________
> dev-usability mailing list
> dev-us...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-usability
>