MyBB Community Forums
Weird occurrence [logged in as another] - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: Weird occurrence [logged in as another] (/thread-228002.html)



Weird occurrence [logged in as another] - GodLess101 - 2020-05-26

Hi, so I've been noticing a weird occurrence on my MyBB forum. I think it might be something related to Google SEO Urls or similar.

Sometimes, when visiting a thread, it will show me logged in as some random user. Weird thing is I tried to echo the mybb->user['uid'], but it didn't show anything. I believe it's a either in caching or cookies, but I honestly have no clue.

Does anyone have any leads or hints to find out the problem? I have too many plugins to deactive/activate, and too many settings I would lose from doing so.

If anyone has ever had this weird 'error' please lmk.


RE: Weird occurrence - Devilshakerz - 2020-05-26

Try setting Send No Cache Headers to Yes (Configuration → Settings → Server and Optimization Options).


RE: Weird occurrence - GodLess101 - 2020-05-26

(2020-05-26, 07:57 PM)Devilshakerz Wrote: Try setting Send No Cache Headers to Yes (Configuration → Settings → Server and Optimization Options).

I tried and it still occurs, so it's not a cache error. This is cranking me up a bit too much because of the fact I'm not entirely too sure about how I should go about debugging it.

What could cause $mybb->user to suddenly not be the same as the session, maybe the reason I can't display the UID is because it is conflicting in some way? I'll try doing an isolated print_r on the $mybb->user and see if anything is even returned.

Thanks for the help though, will update with what I find.

Edit:

And well, I wasn't able to echo or print anything on that page, only if I went to the post (by post id), which enforces my thought of it being Google SEO .. Just sad since the plugin is very useful.


RE: Weird occurrence - Devilshakerz - 2020-05-26

Try this modification of inc/functions.php: https://github.com/mybb/mybb/pull/3970/files#diff-7fe6e55397c77ab9a0f5d57bc4cbe5b9 (replaces 4 headers with one Cache-Control: no-cache, private) with the Send No Cache Headers enabled.

Make sure there is no server-side caching, like Varnish or mod_cache (the MyBB setting, with original and modified code, also attempts to prevent such mechanisms from caching dynamic pages - usually that's the root cause).


RE: Weird occurrence - GodLess101 - 2020-05-27

(2020-05-26, 10:41 PM)Devilshakerz Wrote: Try this modification of inc/functions.php: https://github.com/mybb/mybb/pull/3970/files#diff-7fe6e55397c77ab9a0f5d57bc4cbe5b9 (replaces 4 headers with one Cache-Control: no-cache, private) with the Send No Cache Headers enabled.

Make sure there is no server-side caching, like Varnish or mod_cache (the MyBB setting, with original and modified code, also attempts to prevent such mechanisms from caching dynamic pages - usually that's the root cause).

This didn't solve it either, problem is, when I access the thread by going to a specific post id it works, don't know if this information helps any. I'm not sure if it is a cache problem anymore.