TYPO3 Extbase失去fe_user认证 [英] Typo3 Extbase losing fe_user authentication
问题描述
我这个小片段在我自己的TYPO3的扩展的用户身份登录:
I have this little snippet for logging in a user with my own Typo3 extension:
$GLOBALS['TSFE']->fe_user->createUserSession(array());
$GLOBALS['TSFE']->fe_user->user = $GLOBALS['TSFE']->fe_user->getRawUserByUid($this->userRepository->findByUsername($winAcc)->toArray()[0]->getUid());
$GLOBALS['TSFE']->fe_user->fetchGroupData();
$GLOBALS['TSFE']->loginUser = 1;
在流体模板,我可以检查,如果用户使用此登录:
In the fluid template I can check if a user is logged in with this:
<f:security.ifAuthenticated>
This is being shown whenever a FE user is logged in
</f:security.ifAuthenticated>
然而此code仅可用于这是在控制器中执行的下一个动作。当前台用户重新加载页面,认证将丢失,也$ GLOBALS [TSFE] - > loginUser为空
However this code works only for the next action which is executed in the controller. When the FrontEnd User reloads the page, the authentication is lost and also $GLOBALS["TSFE"]->loginUser is null.
为什么会出现这种情况?
Why is this happening?
推荐答案
欧凯,我对这个问题的解决方案。在Typo3的6.2 LTS似乎有不同的cookie处理。该Cookie fe_user cookie不会被设置。使用TSFE的任何方法来强制TYPO3设置此cookie。
Okey, I have the solution for this problem. In Typo3 6.2 LTS there seems to be a different cookie handling. The cookie fe_user cookie is not being set. Use any method of TSFE to force typo3 to set this cookie.
这篇关于TYPO3 Extbase失去fe_user认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!