【发布时间】:2023-03-11 01:44:01
【问题描述】:
我在 Joomla! 的 controller 中看到了 setRedirect 函数的奇怪行为!
我在管理员上有一个方法,允许以用户身份登录。奇怪的是,它在某些机器上运行良好,而在其他机器上,管理员被重定向但没有登录。
我发现问题发生在 Joomla 的 setRedirect 上,因为 header() php 函数运行良好。有人有想法吗?
非常感谢!
public function loginFromAdmin()
{
$userid = JRequest::getVar('id');
$user = JUser::getInstance($userid);
$session =& JFactory::getSession();
$session->set('user', $user);
$this->setRedirect('https://abc.com/index.php/xyz');
}
【问题讨论】:
-
您使用的是什么版本的 Joomla?
-
我正在使用 Joomla! 2.5.
标签: php redirect joomla controller