1function createCookie(name,value,minutes) {
2 if (minutes) {
3 var date = new Date();
4 date.setTime(date.getTime()+(minutes*60*1000));
5 var expires = "; expires="+date.toGMTString();
6 } else {
7 var expires = "";
8 }
9 document.cookie = name+"="+value+expires+"; path=/";
10}
11
12createCookie("name", "value", 5)
13