Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

logged in user information gets interchange with another user

Avatar

Level 2

I have the below use case: I am using AEM 6.4 version. There is a third party integration with Magento. The session object gets interchange(i think so) as the logged in user information (first name, last name) gets interchange with another user,for example User A is logged in but intermittently on page header it shows user name as B or any other random user name, sometimes it shows correct user name as well. The sling model is using in the code to retrieve the session id and then fetching the user info from AEM repository and displays it on UI but on contrary the session is perfectly managed on Magento pages (It shows correct user name when clicked on username hyperlink on AEM header page, on click it takes to magento user info page.)

Pls do let me know any clues for this, due to this intermittent behavior user is not able to use add-to-cart functionality( as session is someone's else)

 

Thanks,

Shivam

1 Accepted Solution

Avatar

Correct answer by
Level 2

Maybe you can provide some parts of your code, but if you are using a servlet to retrieve that data, you should read: https://blogs.perficient.com/2017/12/05/2-common-concurrency-pitfalls-in-aem-and-how-to-avoid-them/ (the "Member Variables in OSGi Services" section).

View solution in original post

4 Replies

Avatar

Community Advisor

Hi @shivama92274331,

 

This should be an issue with the model which is fetching the user session. Please find my answer here. I have tried it from my end and it worked fine for me.

 

Hope this helps.

 

Thanks,

Kiran Vedantam.

Avatar

Level 2

Hi @Kiran_Vedantam ,

 

I have tried your solution but unfortunately it didn't work.

Avatar

Community Advisor
Can u pls check in the logs or by debugging, which user is it trying to access?

Avatar

Correct answer by
Level 2

Maybe you can provide some parts of your code, but if you are using a servlet to retrieve that data, you should read: https://blogs.perficient.com/2017/12/05/2-common-concurrency-pitfalls-in-aem-and-how-to-avoid-them/ (the "Member Variables in OSGi Services" section).