当我们使用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 Cookie 和 Set-Cookie header 字段。
关于php - 客户计算机上创建的 cookie 在哪里,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13414830/