Writing cookies with JS is hard and easy, but it is simple. Just write document.cookie=.. directly. The difficulty is that some of the keys in the cookies already exist. I want to use JS to rewrite this. Sometimes when you use document.cookie to write, you just rewrite the key again. Sometimes the writing cannot be successful (sometimes characters that require the escape function will appear, and the specific reason is unclear). Anyway, It was very troublesome. Later I saw that there is a cookie plug-in for Jquery, which felt good. However, when tracking and debugging, I found that there was still an extra value with the same name written on the cookies, which was troublesome. Later I saw someone on the Internet talking about using this method, and I felt Not bad
$.cookie('key', '', { expires: -1, path: '/' }); You can delete the value to be reset, not bad