Black Friday 40% off yearly and lifetime plans · 18d left Ends in 18d09h23m Claim 40% off
Security38 docs

How to Enable Stay Logged In in WordPress

Allow users to stay logged in for an extended period (30 days by default) in Classic Monks. Users don’t need to log in again on every visit, even after closing the browser.

By Founder & Lead Developer

Last updated

2 minutes

Key takeaways

  • Single toggle, no nested options
  • Extends the auth cookie duration to 30 days
  • Works alongside the standard “Remember Me” checkbox
  • Users stay logged in even after browser close
  • Configurable duration via filter

What Is the Stay Logged In feature?

By default, WordPress’s “Remember Me” checkbox extends the auth cookie to 14 days. The Stay Logged In feature extends this to 30 days (configurable).

The difference: 14 days vs 30 days may not seem significant, but for users who frequently visit your site, it means fewer login interruptions.

Why You Need It

The default 14-day auth cookie is fine for most sites, but for some use cases, a longer duration is better:

  • Frequent visitors: Users who visit the site daily benefit from fewer login interruptions
  • Internal tools: For sites used as internal tools (e.g., a CRM, project management), users don’t want to log in every 2 weeks
  • Trusted environments: For sites in trusted environments (e.g., company intranets), longer sessions are appropriate
  • E-commerce admin: For store admins, frequent logins are disruptive

For most public-facing sites, 14 days is appropriate. For internal tools or trusted environments, 30 days is a small improvement.

Trade-offs vs standard 14-day session

Extending the session has trade-offs:

  • Lost device: A 30-day session is still valid after the device is lost or stolen
  • Compromised credentials: If a user’s password is compromised, the attacker has up to 30 days of access
  • Compliance: Some regulations require shorter session durations for sensitive data
  • User experience: For users who share devices, the longer session is a risk

For most sites, the trade-offs favor the standard 14-day session.

How to Enable Stay Logged In in WordPress

  1. Step 1

    Navigate to Settings

    Click into the Classic Monks plugin settings in your WordPress dashboard.

  2. Step 2

    Go to the Security Tab

    Click on the Security menu, then click the Stay Logged In subtab.

  3. Step 3

    Enable Stay Logged In

    Scroll to Enable Stay Logged In and toggle on.

    Enable stay logged in WordPress

  4. Step 4

    Save Changes

    Click Save Changes.

  5. Step 5

    Test

    Log in with the “Remember Me” checkbox checked. Close the browser. Wait 15 days (or manually advance the system clock). Log in again. The session should still be valid.

Configuration Options

Option Description Default
Enable Stay Logged In Master toggle. Off

The session duration is set to 30 days by default. To customize, adjust the session duration in the plugin settings under Security > Stay Logged In.

What Gets Affected

  • The auth cookie duration: extended to 30 days
  • The user experience: fewer login interruptions
  • The security: slightly reduced (longer window for compromised credentials)
  • The session management: still works the same way (login, logout, expire)

What Does NOT Get Affected

  • The user roles: not affected
  • The WordPress admin: not affected (after login)
  • The REST API: not affected
  • The application passwords: not affected

Advanced Options (Developers)

This feature registers 2 WordPress hooks in stay-logged-in.php:

Actions:

  • login_footer calls cm_remember_me_checked() (Auto-checks Remember Me checkbox)

Filters:

  • auth_cookie_expiration calls cm_stay_logged_in() (Extends cookie expiration time)
// Hooked in stay-logged-in.php
add_filter( 'auth_cookie_expiration', 'cm_stay_logged_in' );

The feature modifies WordPress behavior by registering or removing hooks. Disabling it reverses those changes and WordPress returns to its default behavior.

Troubleshooting

4 problems and how to fix each one.

The session still expires after 14 days

Cause: The toggle is off, or another plugin is resetting the auth cookie.
Fix: Verify the toggle is on. Check for plugins that filter the auth_cookie_expiration hook and reset the duration.

The session is too long

Cause: The default 30-day duration is too long for some use cases.
Fix: Adjust the session duration in the plugin settings under Security > Stay Logged In. For per-role control, configure different durations for different user roles in the settings.

Users are being logged out unexpectedly

Cause: The auth cookie may be cleared by browser settings or privacy extensions.
Fix: Check browser settings. The auth cookie is stored as a persistent cookie, so “Clear cookies on exit” will not clear it (but “Clear all cookies” will).

I want to log out users on a schedule

Cause: The session extension is passive (no auto-logout).
Fix: Use the Auto Logout feature for active session management. Or use a custom plugin to periodically force logout of inactive users.

Was this doc helpful?

Your answer tells us which docs to fix first.

Still stuck? Ask on the forum or email help@classicmonks.com.
Joy Chetry
Written by the person who built it

Joy Chetry

Founder & Lead Developer, Classic Monks

Joy is the founder of Classic Monks and GoodMonks Solutions, a web development agency that builds WordPress and WooCommerce sites for clients. Classic Monks grew out of the agency's own need to consolidate 20 to 30 separate plugins into one core stack.

Follow this doc on a real site.

Open a private WordPress site with Classic Monks, WooCommerce and Bricks Builder installed, and follow this doc step by step. Free for 24 hours, no card.

280 docs, written by Joy Chetry 15 day refund window