Keeps logging users out

ave
User ww
User ww
Posts: 21
Joined: Wed Jul 12, 2017 12:18 pm

Keeps logging users out

Post by ave » Sun Mar 03, 2019 6:27 pm

Hello Axe,
first of all - you made a great plugin, thank you for that. But, it is so frustrating - for a year now I constantly experience random logouts, and other users report the same problem to me.

I tried every single trick I could find - with no success. PhpBB cookies are fine (.domain.com), secure is checked, and also the same settings are in wordpress (domain name is .domain.com). All throughout the site https is forced, so it is not http/https problem.

So, logout happens when I login, and leave for a few minutes. Then I return to site index, click on latest topic (widget), and already I can see in my inspector (applications -> cookies) that phpbb3 _k cookie is empty. Also, phpbb3 _sid is not empty, but has value that doesn't exist in my database (phpbb_sessions table). So, basically, at that moment - I am logged out.

I changed phpBB security settings, removing "Session IP validation" and "Validate Referrer". No effect.

I should mention that everything works perfectly well while I surf just through wordpress side - there is no sudden logout. The same thing happens when I visit my forum directly and surf there without going back to wordpress - no logout. That made me believe that the problem lays in w3.

Thank you for any suggestion because I am running out of ideas...

User avatar
axew3
w3all User
w3all User
Posts: 1595
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Keeps logging users out

Post by axew3 » Sun Mar 03, 2019 9:53 pm

Hello!
So, logout happens when I login, and leave for a few minutes
When you login in phpBB OR using wordpress login OR both? You noted this?
As i understand you do not use iframe mode. Or yes?
When you login via wordpress, the same happen?
Which are in wordpress, plugins that interact with wordpress login?

ave
User ww
User ww
Posts: 21
Joined: Wed Jul 12, 2017 12:18 pm

Re: Keeps logging users out

Post by ave » Sun Mar 03, 2019 10:54 pm

axew3 wrote:
Sun Mar 03, 2019 9:53 pm
When you login in phpBB OR using wordpress login OR both? You noted this?
As i understand you do not use iframe mode. Or yes?
When you login via wordpress, the same happen?
Which are in wordpress, plugins that interact with wordpress login?
Both logins - the same result.
I dont use iframe, no.

Only plugin that could have cause trouble was w3 total cache, but I tried disabling it and the problem remained...

User avatar
axew3
w3all User
w3all User
Posts: 1595
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Keeps logging users out

Post by axew3 » Sun Mar 03, 2019 11:20 pm

a stupid thing: is the remember me login setting active option ON in phpBB acp cookie settings?

thinking how can be possible that the phpBB_k cookie resetted...
i neglected this that is the clue sorry

User avatar
axew3
w3all User
w3all User
Posts: 1595
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Keeps logging users out

Post by axew3 » Sun Mar 03, 2019 11:26 pm

can you check if immediately after a login in wp side with remember me option, the k cookie is filled or not?
Because this is the problem. If this cookie isn't filled, the login isn't a remember me login, when session expire then you are logged out.

ave
User ww
User ww
Posts: 21
Joined: Wed Jul 12, 2017 12:18 pm

Re: Keeps logging users out

Post by ave » Mon Mar 04, 2019 7:59 am

Thanks for quick reply!
So, last night I changed session duration time (in phpbb admin) to 7200 seconds. This morning I visited site index (WP side) and I was still logged in. Next click was some topic on forum (still logged in), but I could see in inspector that _k cookie was empty. So, naturally, next click anywhere resulted in logout.

About what you asked: "Remember me" is checked...

Second question - I tried going to WP side and login there though widget - and _k cookie was there after login. But, I think that login was done though phpBB side. So, I tried to login through /wp-admin link, and without visiting phpBB - inspector showed that _k cookie was there. Why on earth would it dissappear, it's beyond my comprehension...

User avatar
axew3
w3all User
w3all User
Posts: 1595
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Keeps logging users out

Post by axew3 » Mon Mar 04, 2019 8:37 am

exactly this is the problem.
Would be more easy for me to understand why with access to this server, or almost visiting the site to exactly understand when it happen, may i can reverse mentally. Can you reply here or pm me the url to the site?
Why on earth would it dissappear
so can you detect this:
login in wp side, then remain in wp side: the k cookie value persist?
in which moment it reset?
When you visit phpBB side?

ave
User ww
User ww
Posts: 21
Joined: Wed Jul 12, 2017 12:18 pm

Re: Keeps logging users out

Post by ave » Mon Mar 04, 2019 8:46 am

axew3 wrote:
Mon Mar 04, 2019 8:37 am
exactly this is the problem.
Would be more easy for me to understand why with access to this server, or almost visiting the site to exactly understand when it happen, may i can reverse mentally. Can you reply here or pm me the url to the site?
Why on earth would it dissappear
so can you detect this:
login in wp side, then remain in wp side: the k cookie value persist?
in which moment it reset?
When you visit phpBB side?
While I remain in WP side - _k cookie persist. It resets when I stay idle for a long time (I changed session length in phpbb admin back to 60 seconds, just to test), and after minute or two staying idle - I visit phpbb and _k is then reset...

I sent you info for test login on my site, so you can try the same principle. Login, surf on WP side and then forget about it for a few minutes. After that, come back and visit forum - I think it will log you out as soon as you try to surf on forum.

User avatar
axew3
w3all User
w3all User
Posts: 1595
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Keeps logging users out

Post by axew3 » Mon Mar 04, 2019 9:35 am

may i'm wrong, but can you please access your ACP
and under
Server configuration -> Security settings -> Remember Me" login key expiration length (in days):
you need to setup this value as 0.
Isn't it? May setup it as 0 and all should work?

ave
User ww
User ww
Posts: 21
Joined: Wed Jul 12, 2017 12:18 pm

Re: Keeps logging users out

Post by ave » Mon Mar 04, 2019 10:19 am

It was set to 365 days. So, I set it now to 0, and we'll see what happens in next few minutes...

Locked