“网页已过期"PHP 中的 $_SESSIONS [英] "Webpage has expired" $_SESSIONS in PHP

查看:55
本文介绍了“网页已过期"PHP 中的 $_SESSIONS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网络应用程序中,我使用 $_SESSIONS 但有时,当用户按下退格键时,他会得到:

<块引用>

网页已过期

留言.

为什么会这样?我该怎么做才能避免这种情况?

解决方案

它还与发送到浏览器的缓存控制指令有关.看看 http://de.php.net/manual/en/session.configuration.php#ini.session.cache-limiterhttp://shiflett.org/articles/how-to-avoid-page-has-expired-warnings 以了解有关缓存设置的更多信息.

http://shiflett.org/articles/how-to-avoid-page-has-expired-warnings:

回顾

为避免页面已过期"警告,请将 session.cache_limiter 设置为私有,并确保使用 POST 方法的任何表单提交到将用户重定向到不同 URL 的中间处理页面.

In my web-application I'm using $_SESSIONS but sometimes, when the users hits the backspace key he gets:

Webpage has expired

message.

Why is this happening? What can i do to avoid this?

解决方案

It also has to do with the cache control directives sent to the browser. Take a look at http://de.php.net/manual/en/session.configuration.php#ini.session.cache-limiter and http://shiflett.org/articles/how-to-avoid-page-has-expired-warnings to learn more about the cache settings.

http://shiflett.org/articles/how-to-avoid-page-has-expired-warnings:

Recap

To avoid "Page Has Expired" warnings, set session.cache_limiter to private, and make sure that any form using the POST method submits to an intermediate processing page that redirects the user to a different URL.

这篇关于“网页已过期"PHP 中的 $_SESSIONS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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