How can I list all cookies for the current page with Javascript?

后端 未结 8 1485
日久生厌
日久生厌 2020-12-13 01:34

Is there any way to, with help of Javascript, list all cookies associated with the current page? That is, if I don\'t know the names of the cookies but want to retrieve all

8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-13 01:56

    No.

    The only API browsers give you for handling cookies is getting and setting them via key-value pairs. All browsers handle cookies by domain name only.

    Accessing all cookies for current domain is done via document.cookie.

提交回复
热议问题