Joomla 上的浏览​​器缓存 $mainframe->redirect [英] Browser caching on Joomla $mainframe->redirect

查看:17
本文介绍了Joomla 上的浏览​​器缓存 $mainframe->redirect的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Joomla 驱动的网站,但在使用 Safari 和新的 Firefox 缓存重定向时遇到了问题.这就是我的意思,用户访问我网站上需要登录的页面,所以我使用 $mainframe->redirect(loginpage) 将他们重定向到登录页面,并传递用户访问的页面的 $_GET 变量本来是想去参观的.

I'm using a Joomla driven site and i'm having problems with Safari and the new Firefox caching redirects. Here's what I mean, a user comes to a page on my site which requires login, so I use $mainframe->redirect(loginpage) to redirect them to the login page, and also passing a $_GET variable of the page that the user was originally trying to visit.

成功登录后,我的脚本重定向回用户试图访问的页面.在 Chrome 中,这可以正常工作,并且可以毫无问题地重定向.在 Safari 和新的 Firefox 中,它会缓存重定向,因此登录后不会重定向回原始页面,而是停留在登录页面上.即使我将原始页面的确切 URL 放入浏览器,它仍然会重定向到登录页面.只有清空浏览器缓存才能访问原来的页面.

After successful login, my script redirects back to the page which the user was trying to visit. In Chrome, this works fine, and it redirects with no problem. In Safari and the new Firefox, it caches the redirect so it doesn't redirect back to the original page after login, and stays on the login page. Even if I put the exact URL of the original page into the browser, it still redirects to the login page. It's only when I clear the browser cache, can I then access the original page.

如果我没有理解,请告诉我,感谢我能得到的所有帮助.谢谢

Let me know if i'm not making sense, appreciate all the help I can get. Thanks

推荐答案

我找到了问题所在.看起来有些浏览器缓存了 301 重定向,这是 Joomla 在 $mainframe->redirect 函数中使用的.我已将其更改为 302 重定向,现在运行良好:-)

I figured out the problem. Looks like some browsers cache 301 redirects, which is what Joomla was using in the $mainframe->redirect function. I have changed it to a 302 redirect and it is now working perfectly :-)

这篇关于Joomla 上的浏览​​器缓存 $mainframe->redirect的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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