MyBB Community Forums

Full Version: [RESOLVED] - User Appears to stay logged in/out w/out browser refresh
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Quote:Issue at hand
The problem I'm about to mention does not happen on the Admin (ACP) side of things, just the forum itself.  I've also changed back to the default theme to test to see if the following still happened there and it did.
Basically it's just as the title suggests, when I login i have to refresh to show that I am actually logged in. Same for logging out, I still appear to be logged in (everywhere) until i hit refresh on all the pages(index, portal etc).

I've tried disabling friendly redirects, the problem still happens.

I also tested to see if this was a 'me' issue and signed in from my wifes laptop, the problem still happened.

If you were to visit my site and click on the Forum link on the menu bar, it will take you to the portal page.  This page specifically is giving me the biggest grief and it's probably how I'm running my site.  I'm using dynamic php inclusion for all the menus.  Probably the most important thing to note about how it works is it's rewrite rule.
RewriteRule ^Forum/?$ /index.php?page=forum [L]

Thats it.  On the PHP side of things i just make sure no one else can go to ?page=forum.  forum is really a php file, forum.php, and exists in my root directory.  It's just a renamed version of portal.php.  The only thing i changed was this:
// set the path to your forums directory here (without trailing slash)
$forumdir = "/home/agentc0re/public_html/agentc0re/forum";

So when i am logged in, and instead of hitting a link within the browser, say i went to the Blog then back to the Forum, it would appear that I am logged out but once you click on a link within the forum you would show as being Online.

Quote:How do I tell if I'm online or offline
There are two things that change when coming online.  First login/register buttons disappear, second a tab on the top right appears for accessing UCP and such.  When logging off, the tab should disappear and the login/register buttons should reappear in their appropriate pages. Big Grin

I hope I've provided enough info.
Thanks,
-Jon

Oh yes, i failed to mention that I've seen this thread:  http://community.mybb.com/thread-126359.html
Followed it, even though everything was set correctly already, and still didn't change a thing.

Okay I've been able to figure out part of the problem.   I've been trying to get good rankings on googles pagespeed insights ranking.  In my header+menu .php file i had this piece of php code:

header("Cache-Control: max-age=86400, must-revalidate");

Removing that fixed the weird... staying logged in even though you've just logged out problem.


So that only leaves me with trying to figure out why when you're at https://agentc0re.com/Forum and you sign in, redirects you back to that page, it looks as if you haven't signed in at all.  It was working before the... well i accidently fubar'd the forums before and had to reinstall from scratch.  So we're on the new fresh install.  Just not sure why it isn't working like it did before.

Alright found the last fix for my problem.  I had to force the landing link from the menu to have a trailing slash.

So instead of https://agentc0re.com/Forum, it had to be https://agentc0re.com/Forum/

I don't understand why, maybe someone could help me to?