Hello all!
Right now I am trying to implement a function which makes it possibable for my users to save a preference on which news site they want to read news from. Check out: -- the function is not implementede yet, as you might have guessed.
I try to store preferences through cookies. But I face a problem when I want to store the second feed url, as I only overwrite the information I added with the first feed url. Can you show how to add values to a cookie which already exists, instead of overwriting it with new information?
The function which I currently use to write my cookies is this one I found in Dreamweaver:
function writeCookie(name, value, hours) {
var expire = "";
if(hours != null)
{
expire = new Date((new Date()).getTime() + hours * 3600000);
expire = "; expires=" + expire.toGMTString();
}
document.cookie = name + "=" + escape(value) + expire;
}
Thank you very much!
Right now I am trying to implement a function which makes it possibable for my users to save a preference on which news site they want to read news from. Check out: -- the function is not implementede yet, as you might have guessed.
I try to store preferences through cookies. But I face a problem when I want to store the second feed url, as I only overwrite the information I added with the first feed url. Can you show how to add values to a cookie which already exists, instead of overwriting it with new information?
The function which I currently use to write my cookies is this one I found in Dreamweaver:
function writeCookie(name, value, hours) {
var expire = "";
if(hours != null)
{
expire = new Date((new Date()).getTime() + hours * 3600000);
expire = "; expires=" + expire.toGMTString();
}
document.cookie = name + "=" + escape(value) + expire;
}
Thank you very much!