Users get logged out randomly. No errors. Nightmare.
Root cause
WP_HOME, WP_SITEURL, and cookie domain mismatch (especially behind proxies or Cloudflare).
Permanent fix
define('WP_HOME', 'https://example.com');
define('WP_SITEURL', 'https://example.com');
define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST']);
This stabilizes sessions instantly.
