【发布时间】:2014-03-20 17:06:36
【问题描述】:
在我当前的项目中,标题只加载一次。项目的所有其余部分都使用 AJAX 方法添加和删除 Windows。
除了一个细节,一切都很好,因为我无法更改标题(页面总是被加载)。如果他的会话已过期,我如何将客户转移到登录屏幕?
到目前为止,我正在使用(在我的会话课程中):
public function LoginRedirect() {
//This function will redirect the user to the login page if the session is not valid. Will send GET Reason.
$urlMessage = rawurlencode(utf8_encode($this->ErrMsg));
echo '<script language="javascript"> window.location = "' . $this->RedirectURL . '?ErrMsg=' . $urlMessage . '";</script>';
}
但我不喜欢使用 Javascript 将页面重定向到登录屏幕。我还有什么其他的技巧可以使用吗?
谢谢
【问题讨论】:
-
我猜你可以在 C 中构建一个 Apache 会话管理模块,然后处理会话和重定向……但我不确定我是否会推荐它——这似乎有点矫枉过正:P
标签: php ajax url-redirection