在后台开发中,经常用到 iframe 做为后台框架。所以就会出现当 session 过期时,局部地址跳转的问题。
echo exit('<script>top.location.href="http://baidu.com"</script>');
在判断 session 时用,就能实现全局跳转。