Js delete cookie

var date=new Date ();
date.setTime (date.getTime ()-1000)
document.cookie= "flag=2; expires=" + date.toUTCString ();

the above code can delete the cookie. when flag=2

the problem is that the value of my flag may be 0 12, these three states,
excuse me, how to delete the cookie? of flag at this time

Feb.15,2022

it deletes flag this cookie , the value is not important

Menu