Gossamer Forum
Home : Products : Links 2.0 : Customization :

Cookie question

Quote Reply
Cookie question
Am trying to use the following to set up a MyLinks sort of thing with cookies/java,


<SCRIPT LANGUAGE = "JavaScript">
%!-- hide it from old browsers
var expdate = new Date ();
FixCookieDate (expdate);
expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000
function FixCookieDate (date) {
var base = new Date(0);
var skew = base.getTime();
if (skew > 0)
date.setTime (date.getTime() - skew);
}
function SetCookie (name,value,expires,path,domain,secure) {
document.cookie = name + "=" + escape (value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
function back(){
history.go(-1);
}
function CreateWindow() {
NewWindow = window.open("<%ID%>",
"ShowWindow",
"toolbar=yes,width=300,height=400,directories=no,status=yes,scrollbars=yes,resize=yes,menubar=yes")
}
function cookiePOST(){
SetCookie("<%Title%>", "<%URL%>", expdate);
alert("This link has been added to your favorites")
}
// --%
</SCRIPT>


Using the following for the links:


%A HREF="Javascript: cookiePOST()">My Links</A%

Question is, every time I run it with just the above on a seperate page, it works, when I put the %A HREF="Javascript: cookiePOST()">My Link</A%
part in the link.html, and the java on the category page , it tells me it has been saved, but no luck on pulling out of the cookie (not being saved)????
Any suggestions??

Trust in your elders, for they hold the key to life...