Components Anywhere

Joomla User not dectected in component

11 months 1 week ago #74425

Andreas Madjari's Avatar Andreas Madjari

I have a component that uses some PHP code to check the group of the current user.
When the component is rendered by Joomla it works.
When I call the same component (even on the same page) with Components Anywhere in a module it behaves as if the user is not logged in.
I literally get two different outputs on the same page from the component: once with user data in the article view, once without user data in the module via Components Anywhere.
The call of JFactory::getUser(); in the component code returns the Guest user when accessed through Components Anywhere.
Pass on cookies is activated - the status of this does not make a difference.
Version used is 4.1.10PRO with Joomla 3.7.5.

11 months 1 week ago #74426

Peter van Westen's Avatar Peter van Westen Admin

Try disabling the caching in the Components Anywhere system plugin settings or add caching="false" to the {component} tag.
Also switch on the Prepare Content option in the module (if this is a module of type 'Custom').

11 months 1 week ago #74427

Andreas Madjari's Avatar Andreas Madjari

Thank you for the quick response and your suggestions, however it is still not working.
I have disabled caching in the Components Anywhere system plugin. No change.
I have then switched on the Prepare Content option in the module (it is of type Custom, as you have correctly anticipated). No change.
I have also disabled caching for the module in the settings. No change still.

11 months 1 week ago #74428

Peter van Westen's Avatar Peter van Westen Admin

Can you give me (super) admin and (s)ftp access so I can take a look?
And tell me on what url I can see/reproduce the issue.
You can use the 'Hidden text' button in the forum editor to hide the confidential information.

11 months 1 week ago #74429

Andreas Madjari's Avatar Andreas Madjari

Confidential information:
(hidden)


You need to be logged into the Joomla site frontend to see the module (please use your admin credentials).

11 months 1 week ago #74430

Peter van Westen's Avatar Peter van Westen Admin

Components Anywhere will read in the contents of the url via cUrl.
At the moment Components Anywhere cannot handle the login state (passing of session).
I'll look into this and see if I can make this work somehow.

11 months 1 week ago #74431

Peter van Westen's Avatar Peter van Westen Admin

Ok, I think I found the problem.
Please try the latest development version from:
www.regularlabs.com/development-releases

11 months 1 week ago #74437

Andreas Madjari's Avatar Andreas Madjari

Thank you for the quick response
I have tried it in the test environment provided to you. Still the same issue persists.
No change compared to the situation before update to the development version.

11 months 1 week ago #74443

Peter van Westen's Avatar Peter van Westen Admin

This seems to be caused by the session handler in Joomla when it is switched to PHP.
When it is switched to Database it is working fine.

This is something that is 'wrong' in the Joomla internals and not something I can fix.

11 months 1 week ago #74483

Andreas Madjari's Avatar Andreas Madjari

Thank you for investigating this issue! I will switch session handling to Database where I need this specific solution.
By this the issue is solved for me. Great work again!