简体   繁体   English

使用 php 重定向时未存储浏览器历史记录 url

[英]Browser hisory not stored url while using php redirect

This problem occurs in all browsers except firefox.除了firefox之外的所有浏览器都会出现这个问题。

In my website, for ex, the home page will be like this www.example.com在我的网站中,例如,主页将是这样的www.example.com

After click signin link, it will be www.example.com/signin.php单击登录链接后,它将是www.example.com/signin.php

After finsihed authentication, I will redirect the page using header function in php to user's prfoile.完成身份验证后,我将使用 php 中的 header function 将页面重定向到用户的配置文件。 So after logged in my page wil be like this.所以登录后我的页面会是这样的。 www.example.com www.example.com

If the user clicked back button, I will check the session in signin.php and again redirect to user's profile page.如果用户单击返回按钮,我将检查 signin.php 中的 session 并再次重定向到用户的个人资料页面。

It works fine for me in firefox.它在 firefox 中对我来说很好用。 Other than that all browsers, If I used header redirection, it will not store the page in browser's history.除了所有浏览器,如果我使用 header 重定向,它不会将页面存储在浏览器的历史记录中。

I mean, I am redirecting the user after authentication in signin page.我的意思是,我在登录页面中进行身份验证后重定向用户。 So the signin.php url not stored in browser history.所以 signin.php url 没有存储在浏览器历史记录中。

So If I use back button, it will go to previous site what I opened before opening my site.因此,如果我使用后退按钮,它将 go 到我在打开我的网站之前打开的上一个网站。

Can anyone help??有人可以帮忙吗?? Thanks in advance.提前致谢。

use $_SERVER['HTTP_REFERER'] for redirection where user came from使用 $_SERVER['HTTP_REFERER'] 重定向用户来自哪里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM