What to do if the page appears that the web page has expired_PHP Tutorial

WBOY
Release: 2016-07-13 10:57:01
Original
1962 people have browsed it

When using the back button of IE or history.go(-1) on the web page, what we see will be the cached page, but after using session_start, this function will force the current page not to be cached, resulting in " Warning: The page has expired."

Solution 1:

Add a sentence

after session_start
 代码如下 复制代码
header("Cache-control: private");

Note that the program cannot produce any output before this.

Solution 2:

Add

before session_start
 代码如下 复制代码
session_cache_limiter('private');

//Do not clear the form, only while the session is in effect

 代码如下 复制代码
session_cache_limiter还有另两个参数的含义:
session_cache_limiter('nocache');// 清空表单
session_cache_limiter('public'); //不清空表单,如同没有使用session

Solution 3

Change the configuration file php.ini. Place this file in

 代码如下 复制代码
session.cache_limiter = nocache

changed to

 代码如下 复制代码
session.cache_limiter = 或者session.cache_limiter = none

and then restart apache.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632124.htmlTechArticleWhen using the back button of IE or history.go(-1) on the web page, what we see will be It is a cached page, but after using session_start, this function will force the current page not to be cached, resulting in...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template