Here, the created cookie is deleted using "expires" variable where you can set expiry time.
<script type='text/javascript'>
document.cookie ="admin=hiox";
function clearcookie()
{
var date = new Date();
var expires = ';expires='+date.toGMTString();
document.cookie = "admin=hiox"+expires;
}
</script>
<input type='button' value='delete' onclick='clearcookie()'>