流速:
- 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']
将设置为为第一个标签设置的相同网址。例如:
示例:
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
答案 0 :(得分:2)
不要在任何地方重定向。在用户已经使用的同一URL上处理重新登录过程。这将保持每个选项卡和浏览器窗口的URL保持不变。