[TYPO3-dev] Check if BE user is logged in
Jigal van Hemert
jigal.van.hemert at typo3.org
Mon Feb 15 19:52:55 CET 2016
Hi,
On 15/02/2016 13:38, Felipe Rodriguez wrote:
> Unfortunately this doesn't solve my problem. The $GLOBALS['BE_USER'] is
> still NULL. But I might have a better understanding of what is
> happening... I checked when the $BE_USER is created with the
> $TSFE->initializeBackendUser(); method. TYPO3 looks for a cookie called
> be_typo_user which in my case doesn't exists for my current domain.
> More precisely this is what is happening: I access the typo3 backend
> using www.domain.tld/typo3. In this installation I have two websites,
> one with domain www.domain.tld and the other with domain
> www.sub.domain.tld. The extension from which I'm calling the
> $GLOBALS['TSFE']->isBackendUserLoggedIn() instruction is under the
> second domain (i.e. under www.sub.domain.tld) which makes me think it
> searches for a cookie called be_typo_user whithin this domain which
> actually doesn't exists.
You can set the [SYS][cookieDomain] (there is also [BE][cookieDomain]
and [FE][cookieDomain]) to
.domain.tld
Now the cookies are valid for the subdomains too.
--
Jigal van Hemert
TYPO3 CMS Active Contributor
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the TYPO3-dev
mailing list