WordPress Keeps Logging Me Out: Session Cookie Fixes (2026)
Disclosure: some links on this page are affiliate links. We may earn a commission at no extra cost to you. How we test and rate hosts.
You log in fine. You edit for five minutes. Then "Your session has expired" and you're back at the login screen. This is a session problem, not a password problem - and it's distinct from the login redirect loop where you never get in at all.
Cause 1: URL Mismatch (Most Common)
The auth cookie is written for the domain in Settings → General. If you log in at https://yoursite.com but Site Address says http://yoursite.com - or www vs non-www differs - the browser won't send the cookie back correctly, and every request looks anonymous. Make WordPress Address, Site Address, and your login URL identical, scheme included. If the values are greyed out, they're set in wp-config.php via WP_HOME and WP_SITEURL - edit them there.
Cause 2: A Plugin Killing Sessions
Security plugins with idle timeouts, membership plugins that log out "inactive" users, and session-management plugins all intentionally end sessions. If logout happens at a consistent interval, that's designed behavior - find the setting and extend it. If it started after a new plugin, deactivate it and test.
Cause 3: Salt Rotation
WordPress auth cookies are signed with the security keys in wp-config.php. Regenerate them (via the wordpress.org secret-key service, a security plugin's "rotate salts" feature, or after a security incident) and every existing session dies at once. That's correct after a compromise - but if a plugin is auto-rotating salts on a schedule, that's your logout loop. Check wp-config.php for AUTH_KEY changes you didn't make.
Cause 4: Cache/CDN Interference
A page cache or CDN that serves the wp-admin or login flow breaks sessions silently. Exclusions needed: /wp-admin/*, /wp-login.php, and any request carrying a wordpress_logged_in_ cookie. In Cloudflare, "Cache Everything" page rules on the whole domain are the classic offender - scope them to exclude admin.
Cause 5: Browser and Multisite Edge Cases
Test in incognito - a corrupted cookie store logs you out on schedule. Multisite adds a layer: switching between mapped domains crosses cookie domains and ends the session by design. And if multiple people share the admin account, WordPress's concurrent-session handling can kick the "other" session - use separate accounts.
Keep Reading
- Login redirect loop - when you never get in at all
- wp-admin not loading - blank admin while the site works
- Mixed content error - SSL mismatches that break cookies too
- Hacked recovery - unexpected salt changes can mean compromise
- Bluehost review 2026
- ERR_CONNECTION_TIMED_OUT on WordPress: Site Can't Be Reached (2026)
What are you building?
Tell us about your project so we can match the perfect hosting plan.
Hosting Cost Calculator
See exactly how much you'll spend on hosting over time. Compare Bluehost vs popular alternatives and discover your potential savings.
Used to calculate transaction fees (Shopify charges 2% on sales)
Frequently Asked Questions
Why does WordPress keep logging me out?
The auth cookie is being invalidated or never set correctly. The usual causes: Site URL and Home URL mismatch (you log in on https://site.com but the cookie is written for http://site.com), a plugin clearing sessions early, a security plugin enforcing short sessions, or your browser/CDN stripping or not storing the cookie.
How is this different from the login redirect loop?
The redirect loop dumps you at the login page before you ever get in - the session never establishes. 'Keeps logging me out' means you DO get in and work, then the session drops later. Redirect loop = URL/cookie domain problem up front; repeated logout = session expiry, plugin interference, or cookie path issues.
What's the fastest check?
Open Settings → General and compare 'WordPress Address' and 'Site Address' - they must match each other AND the URL you actually log in at, including http vs https and www vs non-www. A mismatch writes the cookie for the wrong domain and every request after login looks unauthenticated.
Can 'Remember Me' or session plugins cause this?
Yes - plugins that extend or shorten sessions, activity-log plugins that kill sessions on 'suspicious' behavior, and security plugins with idle-timeouts are frequent culprits. Also check your wp-config for a define('AUTH_KEY'...) salt change - rotating salts invalidates every existing session, which is correct behavior after a hack but confusing otherwise.
Does a CDN or caching plugin cause logouts?
Yes, if it caches the admin or login pages, or strips cookies. Cloudflare's 'Cache Everything' on wp-admin, or a page cache serving a logged-in page to a logged-out session, breaks sessions. Always exclude /wp-admin/, /wp-login.php, and any cookie-bearing request from page caching.
Ready to launch?
Get Bluehost from $3.99/month with a free domain, free SSL, and 30-day money-back guarantee.
Related Articles
Bluehost vs Competitors: The Technical Deep Dive
We ran 47 benchmarks over 90 days. Here's the raw data on why Bluehost dominates.
Fix ERR_TOO_MANY_REDIRECTS in WordPress (2026): The 6 Real Causes
ERR_TOO_MANY_REDIRECTS means an infinite redirect loop. Match your Site URLs, fix Cloudflare SSL mode, reset .htaccess, kill plugin conflicts - step-by-step with code.
WordPress 403 Forbidden Error: 7 Fixes That Actually Work (2026)
403 means the server understood you but refuses to serve the page. Fix file permissions (755/644), regenerate .htaccess, kill security plugin blocks - in the right order.
Fix 502 Bad Gateway in WordPress (2026): Diagnose First, Then Fix
502 means the gateway got a bad response from your server - usually PHP timeouts, CDN issues, or overload. A 9-step diagnostic workflow from browser checks to server logs.
Fatal Error: Maximum Execution Time Exceeded - 6 Fixes (2026)
max_execution_time kills slow updates at 30-60s. Fix the culprit plugin/theme first, then raise the limit via wp-config, .htaccess or php.ini - with exact code.
HTTP Error Uploading Images in WordPress: 9 Fixes Ranked (2026)
The vague 'HTTP error' on image upload usually means memory limits or Imagick. Fix order: rename the file, bump memory, force GD library, check permissions - with code.