Fixing bug on automatic base URL computation. Formatting AkObserver documentation.
[akelos.git] / public / javascripts / cookies.js
blobbfa87d847d03147ed6563d7592bb871f665d7f08
1 function createCookie(name,value,days)
3 if (days)
5 var date = new Date();
6 date.setTime(date.getTime()+(days*24*60*60*1000));
7 var expires = "; expires="+date.toGMTString();
9 else var expires = "";
10 document.cookie = name+"="+value+expires+"; path=/";
13 function readCookie(name)
15 var nameEQ = name + "=";
16 var ca = document.cookie.split(';');
17 for(var i=0;i < ca.length;i++)
19 var c = ca[i];
20 while (c.charAt(0)==' ') c = c.substring(1,c.length);
21 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
23 return null;
26 function eraseCookie(name)
28 createCookie(name,"",-1);