the code is as follows:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
function setc(name, value, expiresHours,domain) {
var cookieString = name + "=" + (!!value?encodeURI(value):"");
if(domain!=undefined)
domain=";domain="+domain;
else
domain="";
//
if (expiresHours > 0) {
var date = new Date();
date.setTime(date.getTime() + expiresHours * 24 * 3600 * 1000);
cookieString = cookieString + domain+"; path=/; expires=" + date.toGMTString();
}
document.cookie = cookieString;
}
setc("hasread",true,250)
</script>
</body>
</html>