流量打开:同Referer的网址为两个不同的浏览器标签,用不同的URL PHP
- user visits a page say www.mysite.com/somepage/1
- user clicks on Log Out button or times out and logs out
*user log out detected redirect to home page but save the referer URL
*redirect to /login?ref=$_SERVER['HTTP_REFERER'] (actual code test if its set)
- user sees login page and relogs back
- user is redirected back to refere url that is saved in $_GET['ref']
的aboe流工程完美第一个浏览器选项卡,如果用户有多个选项卡打开然后$_GET['ref']
被设置为相同的URL这是为第一个选项卡设置的。例如:
实施例:
Tab 1 : /somepage/hello/world
Tab 2: /another/page/1
当用户从标签注销1被重定向到:
/login?ref=http://site.com/somepage/hello/world (CORRECT)
如果用户刷新上标签2的页面被重定向到:
/login?ref=http://site.com/somepage/hello/world
NOT CORRECT, IT SHOULD REDIRECT TO:
/login?ref=http://site.com/another/page/1
不可能。您无法可靠地检测到用户是否在您的站点上打开了多个窗口/选项卡,或者某个事件来自哪个特定窗口。 – 2013-04-05 19:52:16
看起来你只是重新定向,以后才能获得HTTP_REFERER。这是非常间接的。只需在重定向之前存储实际的URL *,然后将其添加为重定向中的参数,以便您已拥有它。 – hakre 2013-04-05 20:59:09