Opera 和 Safari 上的 CodeIgniter 会话问题

发布于 2024-09-16 08:48:32 字数 391 浏览 13 评论 0原文

我正在使用 codeigniter 1.7.2。

在我的网络应用程序中注销后,单击浏览器的后退按钮,页面将重新加载到登录页面中。

此问题仅发生在 OperaSafari 上。 我已经使用元禁用了缓存,但这没有帮助。 :(

<meta http-equiv="PRAGMA" content="NO-STORE" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="CACHE-CONTROL" content="NO-STORE" />

请帮忙..

I am using codeigniter 1.7.2.

In my web app after logging out, on clicking the back button of the browser the page is reloaded in the logged in page.

This issue is occuring on Opera and Safari only.
I have disabled cache using meta, but that doesn't help. :(

<meta http-equiv="PRAGMA" content="NO-STORE" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="CACHE-CONTROL" content="NO-STORE" />

Please help..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

下壹個目標 2024-09-23 08:48:32

您能展示如何使用元禁用缓存吗?

浏览器使用单独的缓存机制来存储浏览器历史记录。即使您禁用了缓存,浏览器仍可能存储浏览器历史记录的页面。 Cache-Control: no-store 标头应该完全阻止存储页面。发送此标头的最佳方法是使用 PHP 而不是依赖元元素:

header("Cache-Control: no-store");

另请参阅:什么是可缓存的,了解 Cache-Control: no-cacheCache-Control: no-store

更新:这在 Opera 中不起作用,至少在 Firefox 和 Chrome 中起作用。

Can you show how you disabled cache using meta?

Browsers use a separate caching-mechanism for browser history. Even if you disabled the cache a browser may still store a page for the browser history. The Cache-Control: no-store header should prevent storing pages at all. The best way to send this header is using PHP instead of relying on meta-elements:

header("Cache-Control: no-store");

Also see: What is Cacheable for the difference between Cache-Control: no-cache and Cache-Control: no-store

Update: This doesn't work in Opera, it works at least in Firefox and Chrome.

羁客 2024-09-23 08:48:32

简短回答:防止 Opera 在历史导航(后退/前进按钮)上使用缓存的唯一方法是使用 Cache-control: Must-revalidate通过 https 提供页面标头。

Short answer: the only way to prevent Opera from using cache on history navigation (back/forward button) is to serve the page over https with Cache-control: must-revalidate header.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文