Feature #77080
openMake permanent anonymous fe_sessions working (set cookie with lifetime)
0%
Description
I expect that my fe_typo_user session is permanent and my fe_session_data is available for the time configured in [FE][lifetime] and [FE][sessionDataLifetime]. [FE][sessionDataLifetime] describes: "Integer: positive. If >0, the session data will timeout and be removed after the number of seconds given (86400 seconds represents 24 hours)." which suggests this should be the case.
When you create fe_session_date like:
$GLOBALS['TSFE']->fe_user->setKey('ses', 'uniqueKey', 'test: '.time()); $GLOBALS['TSFE']->fe_user->storeSessionData();
It seems that there is a cookie set named "fe_typo_user" without a expiration date. So if you close your browser completely and return to the website the "fe_typo_user" cookie was destroyed.
This is because:
"\TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication->isRefreshTimeBasedCookie()" which is called by "AbstractUserAuthentication->setSessionCookie()" depends on $this->user for setting a expiration date on the cookie.
Can you guys please check/fix this one?
A simple workaround for now was to create a custom user (but didn't check if there were any complications).
$GLOBALS['TSFE']->fe_user->setKey('ses', 'uniqueKey', 'test: '.time()); $GLOBALS['TSFE']->fe_user->user = ['ses_permanent' => TRUE]; $GLOBALS['TSFE']->fe_user->storeSessionData();
Updated by Helmut Hummel about 8 years ago
- Tracker changed from Bug to Feature
perma login (cookie with a dedicated lifetime) is only implemented for authenticated frontend sessions.
Implementing that for anonymous sessions, would be a feature that could go in an new minor version, but not in released versions.
When implementing that it would make sense to review the current fe-session handling regarding permalogin and maybe simplify the configuration.
Updated by Helmut Hummel about 8 years ago
- Subject changed from Permanent fe_sessions are not working, fe_session_data lost, [FE][sessionDataLifetime] is ignored to Make permanent anonymous fe_sessions working (set cookie with lifetime)