Skip to main content

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.

Jose F

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!