I am working with it for an hour but I can't figure out what is wrong in that.
<html>
<body>
    <input type="button" value="set" onclick=setcook()>
    <input type="button" value="get" onclick=getcook()>
    <script>
        function setcook() {
            document.cookie = "un=nu";
        }
        function getcook() {
            if (document.cookie.length != 0)
                alert(document.cookie);
            else {
                alert("cookie not available");
            }
        }
    </script>
</body>
</html>
 
     
    