Hi I have made a program in which we have to read cookies through javascript but I am facing a problem in it. And I am unable to understand where the problem is? Please help me understand the same.
<html>
<head>
<title>read cookies</title>
<script language="javascript">
function gettime(){
if(document.cookie)
{
index=document.cookie.indexOf(cookie_name);
if(index!=-1)
countbegin=(documnet.cookie.indexOf("=",index);
countend=document.cookie.indexOf(";",index);
if(countend == -1)
countend=document.cookie.length;
}
count=document.cookie.substring(countbegin,countend);
if(count==1)
return(count+"time");
}
else
{
return(count+ "times");
}
}}
return("0 times");
}
</script>
</head>
</html>