I have several registered user and parts (pages) of the site that can only be accessed by certain user groups / users.
When I want to catch more information about the current logged in user ... I send the uid and userame via typoscript to the frontend (fluid template) like this:
tyoscript:
lib.uid = TEXT
lib.uid.data = TSFE:fe_user|user|uid
lib.username = TEXT
lib.username.data = TSFE:fe_user|user|username
Main_layout.html:
<div class="container mainbox">
<div itemscope itemtype="http://schema.org/Corporation">
<f:render section="content" />
<script>
var userID = '';
var userName = '';
userID = '<f:cObject typoscriptObjectPath="lib.uid" />';
userName = '<f:cObject typoscriptObjectPath="lib.username" />';
console.log(userID);
console.log(userName);
</script>
</div>
</div><!-- /.container -->
But when testing different users ... I sometimes don't get the correct user information of the current logged in user. The information in the edit profile (with femanager) is correct ... but when looking in the console ... I sometimes get the information of the previous tested user.
What might causes this?
Could you add your TypoScript code? I used a COA_INT object on page and it seems to work:
I think you could write something like: