Keep Users Logged In to FluentCommunity PWA
Hi Community,
Is there a setting that controls how long users stay logged in to the FluentCommunity PWA?
The users in my community can install the PWA on their phones, but after a short time, they get logged out and need to sign in again. Iβd like them to remain logged in indefinitely, or at least for a much longer period. I'm using Pro version 2.11.0.
I noticed that in this community, I never seem to get logged out.
Could you please let me know which settings I need to configure to achieve the same behavior?
Thank you in advance!
Hi! Unless FluentCommunity is applying any additional session restriction (I think itβs not) this is mainly controlled by WordPress itself rather than by the PWA.
By default, WordPress authentication cookies expire after:
- 2 days for a normal login.
- 14 days when βRemember Meβ is enabled.
You can change this duration using WordPressβ native auth_cookie_expiration filter.
For example, to keep the login valid for 90 days:
add_filter( 'auth_cookie_expiration', function( $expiration, $user_id, $remember ) {
Β Β return 90 * DAY_IN_SECONDS;
}, 99, 3 );
You could add this through a small custom plugin, your child theme, or a code snippets plugin.
Personally, I wouldnβt make sessions literally indefinite, but something like 30, 90 or even 365 days can provide a much smoother PWA experience depending on the security requirements of the community.
Also worth checking whether any security/session-management plugin is invalidating WordPress sessions earlier, as that could explain users being logged out sooner than expected.
Jorge de los ReyesΒ Muchas Gracias Jorge! I use WP Security Ninja. I'll check if it is invalidating WP sessions earlier and try with the snippet. Thanks for it. I really appreciate it!