How to delete a cookie using jQuery?

后端 未结 7 2186
终归单人心
终归单人心 2020-11-27 15:27

I want to use jQuery to delete cookies; I have tried this:

$.cookie(\'name\', \'\', { expires: -1 });

But when I refresh the page, the cookie

7条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 15:33

    What you are doing is correct, the problem is somewhere else, e.g. the cookie is being set again somehow on refresh.

提交回复
热议问题