是否可以使用jQuery读取HTTPONLY cookie? [英] Is it possible to read HTTPONLY cookies with jQuery?

查看:699
本文介绍了是否可以使用jQuery读取HTTPONLY cookie?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法用jQuery读取标记为HTTPONLY的cookie?我有一个名为wishlist_cookie的cookie.

Is there any way of reading cookies marked with HTTPONLY checked, with jQuery? I have a cookie named wishlist_cookie.

当我尝试

$.cookie('wishlist_cookie');

即使有值,它也会返回NULL.

It returns NULL even if it has a value.

推荐答案

HttpOnly cookie对客户端脚本语言不可用,无法获取和设置它.有关详细信息,这是将Cookie设置为通过Java HttpOnly 的详细信息.

HttpOnly cookie is not available to client-side scripting languages, there is no way to get and set it. Here is the link Set a cookie to HttpOnly via Javascript for details.

这篇关于是否可以使用jQuery读取HTTPONLY cookie?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆