eZ Community » Forums » Developer » eZUser::isUserLoggedIn returns true...
expandshrink

eZUser::isUserLoggedIn returns true for anonymous

eZUser::isUserLoggedIn returns true for anonymous

Wednesday 18 May 2011 4:26:44 pm - 2 replies

I tried several methods to check if user is logged in.

The most convenient method would be:

$userId = eZUser::currentUserID();
eZUser::isUserLoggedIn($userId);

But this returns true even if no user is logged in and $userId is '10' (= anonymous). I even tried calling
eZUser::cleanupCache();
eZUser::clearSessionCache();
before. Same result.

So the only reliable method to get loggedin-information seems to be:

$user = eZUser::currentUser();
$user->isLoggedIn();

Modified on Wednesday 18 May 2011 4:34:08 pm by Horst Lindlbauer

Wednesday 18 May 2011 11:54:02 pm

Version? There was something like this in 4.4 that was fixed but might not be the same issue.

Thursday 19 May 2011 12:42:36 pm

We are using 4.3.0

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from