Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Why is my staging subdomain not sending wordpress_logged_in cookies?

I noticed that the staging environment had different content in its wp-config.php and .htaccess files. I changed them to be closer to the ones on the live environment.

While I was there, I noticed that some of the differing content was related to various caching plugins that we previously had installed on the staging environment. In desperation, I reinstalled all of those plugins through wp-admin and then uninstalled them.

Surprisingly, that fixed the issue of the cookies not being sent. However, the cookies had incorrect paths or domains. After some trial and error, I finally got it working by adding these seven lines to wp-config.php:

define('ADMIN_COOKIE_PATH', '/wp-admin');
define('COOKIE_DOMAIN', '');
define('COOKIEPATH', "https://wordpress.stackexchange.com/");
define('SITECOOKIEPATH', "https://wordpress.stackexchange.com/");
define('DOMAIN_CURRENT_SITE', 'test.example.com');
define('WP_HOME','https://test.example.com');
define('WP_SITEURL','https://test.example.com');

My assumption is that one or more of the caching plugins hadn’t cleaned up after itself when we uninstalled it.

Related Posts:

  1. How to save generated JWT token to cookies on login?
  2. Login cookies set as wrong domain
  3. WordPress Admin login redirect to homepage
  4. Why does WordPress use cookies for /wp-admin and /wp-content/plugins for non-admin users [duplicate]
  5. How to resolve these findings from security audit
  6. ERROR: Cookies are blocked due to unexpected output – no access to FTP
  7. Login with OpenID, similar to Stack Exchange sites?
  8. How can I make an Ajax login form work with FORCE_SSL_ADMIN enabled?
  9. Keep one user logged for a year?
  10. Disable saving comment details (name, e-mail) in cookie?
  11. Change success message in plugin Theme my login
  12. How to get Login Error messages on a custom template
  13. Pushing changes from localhost to live server?
  14. How can a Firebase user registration and login be integrated into a WordPress site?
  15. How to get user-meta from Social Login registered users?
  16. Change wp-login to custom URL login page
  17. Login problem after installing my written plugin [closed]
  18. Too many login attempts
  19. Get ‘Headers already sent’ error for the plugin I am creating when I try to login
  20. Custom Login Page — wp_signon Headers Already Sent?
  21. Theme My Login Shortcode Doesn’t Return Anything
  22. Displaying content based on drop-down menu selection sitewide
  23. Possibility to login without password
  24. how do i change my website facebook login button to another text immediately user login? [closed]
  25. Best way to salvage a very old WP site
  26. WordPress unable to write files in the server
  27. Blurry images when loading the page first time
  28. Custom PHP Page Using WordPress login
  29. How to Use the Filter “sidebar_login_widget_form_args”
  30. Manage PDF downloads and protected pages
  31. If I use an alternative login (e.g. CAS or other SSO) plugin, is my site protected from the recent brute force login attempts?
  32. login in wordpress using gmail account
  33. How can I replace content on site generated from plugin without changing plugin
  34. Janrain/Simple Modal under Redirected Domain
  35. Cookies set by a plugin in wordpress for tracking
  36. Codeless random token generation to pass into multiple tracking links in a single page load
  37. Linking form to user meta fields
  38. WordPress Multisite Profile Picture Sync Error with Nextend Social Login Plugin
  39. Plugin or ways to limit number of users logging in the website,
  40. force logged in user to stay in the dashboard
  41. Identify User Language, Redirect to the corresponding page and Save the chosen language as Cookie
  42. Cookie value changes back to previous value after changing
  43. Display value of the GET parameter in a new URL page
  44. Share login credential with QR code
  45. Merging new theme and plugins from development site to production
  46. Which membership plugin for a simple sign in? Personal areas for customers
  47. Discern a specific plugin’s action hooks
  48. Block Google tracking on refuse consent of the user with plugin
  49. Login/password protected “client page”
  50. https rewrite not working for All in one security Brute force > rename login url
  51. On button click, redirect users to registration page instead of another page
  52. How can I show login popup when user clicks on download button
  53. When the user entered an unauthorized url redirect to login page
  54. How to show private pages based on a user’s role?
  55. How can I store user preferences in WordPress and retreive them later?
  56. WordPress delete cookie
  57. Admin Custom Login loses settings on Code and Data migration
  58. Image paths wrong after migrating with wp-migrate-db-pro media files add-on
  59. Implementation to count page visits of unique visitors based on a cookie
  60. admin-ajax.php not working properly on subdomains
  61. Cookie set in a plugin visible in admin but not on front
  62. using wordpress login details for other website / application / forum?
  63. How can I save cookies to members
  64. wp_signon returns user, in popup window, but the user is not logged in
  65. How to Create Custom Dashboard for my Laundry Website?
  66. wp_login_form() ignoring login_form action hook
  67. User content database [closed]
  68. Auto-login from backend
  69. AJAX login without a plugin does not work. when add a action to function.php
  70. Plugins effecting layout & login
  71. Redirect default login page to a custom page [duplicate]
  72. wp-admin will not redirect to wp-login.php
  73. Migrating site from stage to production server without particular dev. plugins?
  74. Adding google authenticator and use only email address of user
  75. Adding a Filter to Sidbar Login Plugin to Change Login Button Lable
  76. set cookies for my whole site is not working
  77. First argument is expected to be a valid callback for cp_admin_init and _canonical_charset
  78. how to protect wordpress website
  79. WordPress ReAuth =1 Loop with wpCAS
  80. HTTP Error 403 When Trying to Login
  81. Advice on setting up private site
  82. Checking url from plugin [duplicate]
  83. What plugin(s) are best for this User registration task? [closed]
  84. Trouble Removing Plugin [closed]
  85. Change All Login/Signup Links in Plugin
  86. How do I to override login redirect on specific pages?
  87. WordPress Plugin: Where should I put my cookies for cURL?
  88. plugin for different writers [closed]
  89. Undefined constant error in pluggable.php
  90. How to Find WordPress site has backdoor login Codes
  91. How to delete Password Protected posts cookies when a user logged out from the site
  92. How to create a custom wordpress plugin for a specific functionality?
  93. WordPress Homepage Login
  94. I cannot login after installing the wp-login timeout setting plugin
  95. Stop the user if login from the cookies
  96. Issue: Unable to Access WordPress Admin and Database Errors
  97. Custom Login and Password Reset for BuddyPress Website
  98. Is there a plugin or resource for custom implementation for OAUTH and regular user login?
  99. How to create WordPress login for different users, with different roles?
  100. Lost Password of my site, how to reset wordpress password?
Categories plugins Tags clone-site, cookies, login, plugins, staging
Print terms with taxonomy and metabox value
Unable to disable Gutenberg with plugin Classic Editor or Disable Gutenberg

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress