php - 客户计算机上创建的 cookie 在哪里

标签 php cookies location

当我们使用php setcookie()函数时,它们是在客户端计算机上的哪里创建的?

最佳答案

当您使用setcookie(),包含一个 HTTP header (Set-Cookie),其中包含有关要设置的 cookie、其过期时间等信息。

Cookie 本身的存储位置由浏览器决定

然后,浏览器发送 Cookie 的内容,该内容存储在某处在适当的时候带有 Cookie: header ,如下所述。

There are two headers, Set-Cookie and Cookie, that are related to cookies. The Set-Cookie header is sent by the server in response to an HTTP request, which is used to create a cookie on the user's system. The Cookie header is included by the client application with an HTTP request sent to a server, if there is a cookie that has a matching domain and path.

<强> RFC6265 定义 HTTP CookieSet-Cookie header 字段。

关于php - 客户计算机上创建的 cookie 在哪里,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13414830/

相关文章:

javascript - 使用 json_encode 从 php 到 javascript 的数据传输

asp.net - FormsAuthentication.SignOut不能与自定义域Cookie一起使用

php - 设置一个 cookie 供 cURL 使用

wcf - 如何在 HttpTransportBindingElement 上添加 cookie

ios - 在 iOS 上持续跟踪用户位置

php - 无需提交即可使用Jquery/Ajax即时更新Mysql表

php - 允许第 3 方身份验证的 CodeIgniter 身份验证系统?

php - 在 PHP 中执行 exec() 或 system() 并且不等待输出

android - 从纬度和经度获取地址

javascript - 是否有测试来确定页面是否要求位置授权?