Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

logged in user information gets interchange with another user

shivama92274331
Level 2
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
lucian_nicolaescu
Correct answer by
Level 2
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
KiranVedantam1992
Community Advisor
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.

shivama92274331
Level 2
Level 2

Hi @KiranVedantam1992 ,

 

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

KiranVedantam1992
Community Advisor
Community Advisor
Can u pls check in the logs or by debugging, which user is it trying to access?
lucian_nicolaescu
Correct answer by
Level 2
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