gpt4 book ai didi

PHP session 添加 header Pragma : no-cache

转载 作者:行者123 更新时间:2023-12-04 15:57:37 26 4
gpt4 key购买 nike

大家好,我的 http header 请求有问题,当我测试 header 时我得到了这个响应

HTTP/1.1 200 OK
Date: Sat, 29 Oct 2016 14:24:31 GMT
Server: Apache
X-Powered-By: PHP/5.6.27
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
check=0
Pragma: no-cache
Set-Cookie: PHPSESSID=2d17992cfbd621c51eca940df478b89a; path=/
Vary: Accept-Encoding,User-Agent
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Security-Policy: allow 'self';
X-Content-Type-Options: nosniff
Cache-Control: max-age=604800, must-revalidate
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
Content-Language: it-it

这部分只有当我在页面上有 session_start() 时才会出现

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
check=0
Pragma: no-cache

在干净的 .php 或 .html 页面上我得到这个响应

  HTTP/1.1 200 OK
Date: Sat, 29 Oct 2016 14:34:27 GMT
Server: Apache
Last-Modified: Sat, 29 Oct 2016 13:15:00 GMT
Accept-Ranges: bytes
Content-Length: 314
Vary: Accept-Encoding,User-Agent
Cache-Control: max-age=604800, must-revalidate
Expires: Sat, 29 Oct 2016 14:34:27 GMT
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Security-Policy: allow 'self';
X-Content-Type-Options: nosniff
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Language: it-it

我尝试到处搜索,但不知道我被屏蔽了有人知道为什么 session_start();添加

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
check=0
Pragma: no-cache

在 http header 中????????

最佳答案

http://php.net/manual/en/function.session-cache-limiter.php

session_cache_limiter('private_no_expire:');
session_start();

关于PHP session 添加 header Pragma : no-cache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40320221/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com