function ClearCookie() {
var expires = new Date() ;
expires.setTime(expires.getTime() - 1000); //The current time minus one second is equivalent to immediate expiration (can be increased or decreased)
document.cookie = "appCode='222''' ;path=/;expires=" expires.toGMTString() ""; //expires is the setting corresponding to the expiration time. If this value is not set, the cookie will expire when the browser is closed by default
document.cookie = "roleID=' 333''';path=/;expires=" expires.toGMTString() "";
document.cookie = "parentMenuID='000''';path=/;expires=" expires.toGMTString() "" ;
document.cookie = "currentMenuName='haha''';path=/;expires=" expires.toGMTString() "";
}
path=/; means The location where cookies are stored is the browser root directory
The above method causes the four cookies appCode, roleID, parentMenuID, and currentMenuName to become invalid.