function temp(cookiename){ var uid=""; var arr=document.cookie.split(";"); for(var m=0;m<arr.length;m++) { var temp=arr[m].split("="); if(temp[0].replace(" ","")==cookiename) { return temp[0]; } } }