This answer may help. To quote:
The basic code you need here is this in the wp-config file:
define('LOGGED_IN_COOKIE', 'login_cookie_name');
define('AUTH_COOKIE','auth_cookie_name');
define('COOKIE_DOMAIN', '.example.com');
define('COOKIEHASH', 'random_hash_here');
Put that in the config across multiple sites, set the keys and salts to be the same, and you’ll have login cookies that work across the domain and subdomains.
Related Posts:
- Should wordpress_logged_in cookie exist while logged out?
- WordPress authentication cookie and ajax calls
- Detect if authentication is set to “remember” a user being logged on
- is_user_logged_in() returns different values on different pages
- Cookie is not set
- Logged In cookie gets saved but not Auth cookie
- Automatic WordPress Login of Logged In ClickFunnels User
- Is it possible to transfer a WordPress session to a different browser via query string?
- How does REST API cookie authentication work in WP 4.7?
- Why does it say: ‘Cookies are blocked or not supported’?
- Place a cookie when a specific page has been viewed?
- How to detect a user that is not logged in
- How to change cookie name
- Using wp_set_auth_cookie for custom user account system
- Keep Users Logged In As Long As I Like
- WP_Http_Cookie destroys cookie value through urldecode()
- Get restrict content by submitting Gravity Forms
- Website Loads Twice Unnecessarily
- Do I use cookies?
- Authentication/API Questions
- Security error WP 4.0 + WP phpBB Bridge [closed]
- Hide/Show content based on cookie
- ERROR: Cookies are blocked or not supported by your browser
- What is cookie “U” from domain “.adsymptotic.com” found on the WordPress page? [closed]
- Rest API authentication issue when called from fetch request in bundle.js
- Serving Cookies From A Different Domain or Sub-Domain
- How to fix samesite attribute in wordpress for chrome errors?
- Secure wordpress_logged_in cookie
- Can’t GET draft posts via REST API from headless frontend
- Configuring WordPress Auth Cookie Expiration
- How does the “authentication unique keys and salts” feature work?
- Deleting cookie to logout
- Set authentication cookies to be shorter but then extend with every page load
- Auth cookie value security risk?
- Unset a Cookie on Successful Gravity Forms form Submission [closed]
- How set a cookie from PHP and get it without refresh
- Why wordpress cookies name contains HASH
- Change the user is logged in cookie name
- Disconnect automattically after X minutes
- can we share user login in 2 wordpress installs in 2 subdomains on one server? [duplicate]
- background/font size change and remember
- WordPress cookies
- Modifying request $_COOKIE
- SSO autologin WordPress + Ajax
- Need help setting cookies with multiple value [closed]
- Enable WordPress to share cookies between domain.com and sub.domain.com
- Setting Cookies
- How I can share cookies from my dimain to subdomain?
- How to setup cookie free domain for wp-includes?
- After logout browser’s back button into twenty sixteen theme profile
- COOKIE_ID with username appended
- What are your thoughts on overriding the PHP builtin setcookie() function to control whether or not WP creates cookies
- How to make use of Transient API as cookie
- Issues with set cookie
- Accept or deny cookies – how to?
- How to set a Cookie-Free Domain with WordPress?
- How to set a cookie for logged in users to md5($user->ID . “my_secret”)?
- Is it possible to use cookie-free domains in WordPress?
- Passing cookies when using wp_remote_get
- Setting cookies in WP REST API requests
- Store value in cookie
- Set Short Automatic Logout Time for One User
- WordPress Post Voting – Vote once per IP on entire site
- Can I “protect” a page with a form asking for an email address?
- wordpress can’t read a cookie?
- Do I need a Cookie consent on a basic WordPress site?
- Page specific cookie
- will creating a static folder in the root directory serve the purpose of loading the static content from cookieless domain?
- Where is function to prevents non logged users access wp-admin?
- How to keep a variable in COOKIE or GET query string?
- Cookie Details Requested
- Cookies in template
- Multiple issues with Ajax login function due to browsers and cookies
- Cookie error. No possibility to define my cookie
- Favicon not loading until cookies are accepted?
- How to verify which WordPress user requested the API in ASP .NET Core?
- can you help review CCCP (Conditional Cookie Content Post) and help to create a block?
- COOKIE_DOMAIN chaos
- Change auth_cookie_expiration for specific roles and specific login times
- How can I get an updated cookie in header.php?
- How are sites using wordpress hiding wordpress cookies that have “wp” or “wordpress” in the cookie name?
- Use WP cookie to authentificate user on an external app
- Correct user session/cookie handling with external site connection in wordpress
- The same session information for peer users on two different WordPress servers
- How to save history in the client’s browser without login? [closed]
- Entirely Cookieless WordPress?
- Extend Cookie with auth_cookie_expiration not working
- Why does WordPress use cookies for /wp-admin and /wp-content/plugins for non-admin users [duplicate]
- When ever wordpress home page refreshes the code is not reading the cookie as set anymore
- http_referrer issue when detecting where site comes from and allow if from allowed host
- detect referr page
- Looking to load a different template part on every load/refresh
- WordPress wp-login.php cookie error (WordPress Version 4.2.9)
- set cookies or let system know a user has been on site
- Opening protected page with cookie?
- setcookie not working when defined with ‘/’ but working if not defined
- How to use Cookie or Session php for one page and just a password
- How to get the id dynamically to store cookies
- Rest Api WordPress
- WordPress Network / Multisite login to one site allow access to all