Check if httponly cookie exists in Javascript

前端 未结 4 1793

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:04

    I had the same problem. I solved it with the server setting another cookie, not httponly, every time it refreshed the httponly session cookie, with the same max-age and no sensitive data. Now, if one of them is present, the same goes for the other, and the client can know if the httponly counterpart is there.

提交回复
热议问题