Check if httponly cookie exists in Javascript

前端 未结 4 1794

As the question says can you find out if a cookie exists within Javascript if it is a HttpOnly? I don\'t need to access the information inside of it, just know it has one.

4条回答
  •  盖世英雄少女心
    2020-12-16 15:18

    No. And see Rob's comments below.

    See this, which you probably already saw - http://en.wikipedia.org/wiki/HTTP_cookie#Secure_and_HttpOnly

    An HttpOnly cookie is not accessible via non-HTTP methods, such as calls via JavaScript (e.g., referencing "document.cookie")...

    Edit: Removed undefined response, I wrote a script that you may not be using :)

提交回复
热议问题