更新时间:2023-11-18 15:28:34
我遇到了同样的问题,但在设置新会话变量之前调用 clear 方法解决了这个问题.
I had the same problem, but calling the clear method before setting a new session variable fixed the problem.
$session = & JFactory::getSession();
/* this way unset data from the session store */
$session->clear('security_code');
/* and now set the new value */
$session->set('security_code', $code);
即使是您第一次声明会话变量也能正常工作.
It works even if is the first time you are declaring a session variable.