[TYPO3-dev] Do a FE_Login in Typo3 6.2 Extension

Frans Saris franssaris at gmail.com
Thu Oct 16 17:51:01 CEST 2014


The cookie handling has changed. What results in no cookie if you login
this way.

What I did was I copied the setSessionCookie()
from AbstractUserAuthentication, added it to my own class and call it as
last action.

gr. Frans

2014-10-16 14:32 GMT+02:00 Benedikt Wiesnet <benedikt at wiesnet.de>:

> Hi everybody,
>
> I have read a lot about how to login a fe_user from php. My Snippet for
> doing this is:
>
> $GLOBALS['TSFE']->fe_user->start();
> $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;
> $GLOBALS["TSFE"]->fe_user->storeSessionData();
>
> And in the view I check if a user is logged in via:
> <f:security.ifAuthenticated>
>
> However, I am able to do a login but after being redirected or navigating
> to another page, the <f:security.ifAuthenticated> is no longer working (the
> user is not logged in anymore). Why is this happening?
>
>
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
>



More information about the TYPO3-dev mailing list