- πΊπΈUnited States frob US
I think I might be experiencing something along these lines as well.
For us storing a value in the browser session is shared when masquerading.
I have been working with a theme that modifies the default link text for logout ( instead of 'Log Out', it says 'Log Out username'). When masquerading as other users, occasionally the 'user' object available to the theme gets stuck as a previously masqueraded user. I was able to reproduce this issue with other themes, so I do not believe it's a theme issue. I'm not sure if this is a security issue or not.
Here are my steps to reproduce:
-No caching
-Aggregate CSS & JS
To see results:
-Modify current theme so that 'user' object is dumped (ie add {{ dump(user) }} in menu.html.twig)
-create series of users (I have 7 users in my test case, some have roles, some do not)
I followed this pattern a few dozen times over my 7 or so users. Most of the time the user you are masquerading as does not match the AccountProxy object. Clearing the cache (theme, render, or routing) takes care of the mismatch. But once you start masquerading around, it happens almost immediately.
To be clear - the Drupal::currentUser and all the logs appear to be working correctly. It's just when you try to access 'user' in the twig templatesthat you run into a weird cache issue.
Postponed: needs info
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I think I might be experiencing something along these lines as well.
For us storing a value in the browser session is shared when masquerading.