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.
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn