jQuery 会在帖子中发送 cookie 吗? [英] Does jQuery send cookies in a post?

查看:24
本文介绍了jQuery 会在帖子中发送 cookie 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道,当我使用 jQuery 制作 $.post(...) 时,是否有任何 cookie 在 post 请求中发送到服务器?

I want to know if, when I make a $.post(...) with jQuery, is any cookie sent to the server in the post request?

谢谢!

推荐答案

Cookie 随 Ajax 请求一起发送.

Cookies are sent with Ajax requests.

当为 cookie 设置 HTTPOnly 标志时,此 cookie 对客户端隐藏-side 脚本,但 cookie 仍然与 Ajax 请求一起发送.

When the HTTPOnly flag is set for a cookie, this cookie is hidden from client-side scripts, but the cookie is still sent with Ajax requests.

这篇关于jQuery 会在帖子中发送 cookie 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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