JavaScript Program to Create a Persistent Cookie Using 'expires' attribute

Write a JavaScript program to create a persistent cookie using 'expires' attribute.

Source Code
    <title>Persistent Cookie example</title>
        function setCookie() 
            var name = document.getElementById('person').value
            document.cookie = "name=" + name + "; expires=Tue, 03 Sep 2019 10:16:00 GMT"
            alert("Cookie Written..")
            document.getElementById('panel').innerHTML = "";
        function readCookie() 
            var cookie = document.cookie
            var panel = document.getElementById('panel')

            if(cookie == "")
                panel.innerHTML = "Cookie not found"
                panel.innerHTML = cookie

<form name="myForm">
    Enter your name <input type="text" id="person"/><br/>
    <input type="button" value="Set Cookie" onclick="setCookie()"/>
    <input type="button" value="Read Cookie" onclick="readCookie()"/>
    <p id="panel"></p>