Short answer: You can’t. That’s not hookable for the settings cookies.
You can adjust the cookie paths and such via defines, so as to make the settings apply across multiple installations across a domain. The most common use of this is to make logins work across a domain, so when you log into one, you log into all subdomain installs as well.
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.
Multisite is simpler.
Related Posts:
- Is there any reason only 1 (my) IP would be added to this table using $wpdn->insert?
- Configuring WordPress Auth Cookie Expiration
- Will setcookie work if there is a cache plugin installed?
- How to set a cookie for logged in users to md5($user->ID . “my_secret”)?
- Setting a JSON web token from a secondary api as a secure cookie on WordPress
- Why setcookie function redirecting to home page in wordpress?
- Rest Api WordPress
- What are the advantages to the Settings API?
- Changing Plugin Load Order
- How to add Request header in WordPress remote api calls
- add_action with a class method is causing fatal errors
- Include third party Javascript library which is not included in WordPress
- Update a Plugin while maintaining back compatibility: general
- Do I need to use WP_Filesystem when creating a downloadable file on the fly?
- Not sure the best way to save custom plugin data
- Plugin development with unit tests
- Change WordPress.org hosted plugin readme.txt
- How does gettext works for translating readme file of plugin?
- How to debug WordPress correctly?
- `wp_set_script_translations` with `wp.i18n` does not return translated strings in simple plugin
- Sessions not creating correctly in custom function
- Problem with `wp_mail()`
- How to add meta boxes to the ‘Add new post’ screen?
- Cannot modify header information – headers already sent by pluggable.php
- htmlentities and editing text
- Gutenberg registerFormatType with Multiple Classes
- Translate strings not recognised in plugin
- Best way to notify WordPress plugin users of new release candidates for beta testing?
- Print WordPress username id inside JavaScript
- How to Download and install plugin database remotely
- How to run a external JavaScript file on wp-admin if admin, and other if normal user?
- WordPress add_admin_page not working even parameters are correct?
- How to use WP_Term with (menu) argument in the wp_nav_menu?
- Turn off Admin Bar (Toolbar) in backend – no easy way
- Any problem in using native jquery ajax style instead of using admin-ajax.php?
- Communicate between plugins
- When to use add_settings_section vs just register_setting?
- WP_Editor – Saving Value into Plugin Option – Stripping HTML
- How to customize login process
- Adding more text to a post, after it was published
- How to modify the comments to be displayed in a post?
- Email verification for new users
- Insert/Update values to a table after blogname option etc. is updated
- Does admin_print_scripts-$hook_suffix work for nested paths to individual files?
- How to add a widget to the post editing view?
- How to query custom db table?
- How to only load css for used blocks on frontend
- Show message from backend
- Cannot change caption for a plugin
- Remove all removed pages from wordpress
- Creating an empty page programatically
- Woocommerce inventory [closed]
- Invalid hook call on save, not edit when using swiper slider
- Call to undefined function is_home() or any conditional tags
- how to load the comment template from a plugin
- Change/Set Page Title and Meta Tags from Page Called within a Plugin
- WooCommerce Endpoints content
- Make dynamic string translatable
- Look for a file in a theme before loading from plugin
- wp_schedule_event is registered but function isn’t running
- Include HTML (Bootstrap Modal Box) with a plugin into my header
- when i activate my plugin i want to auto create pages with shortcodes
- Using init hook for register_taxonomy is causing invalid_taxonomy in wp_insert_term()
- Simple plugin don’t display content
- How to display TinyMCE HTML view?
- Downloading File via headers doesnt work
- get the permalink error
- Cannot output plugin twice with shortcode
- How to make an admin plugin menu page go full screen?
- Gutenberg – Call google map render function in save after DOM has been rendered
- Woocommerce get_term_by() in transition_post_status hook doesn’t works
- Does $this context change in an AJAX callback?
- Home page is not loading, where in other pages are displaying on the site
- Custom table / Alternative to WP_List_Table
- WordPress custom url without using any of the custom tags given
- WordPress with React: Saving and Using Data Collected with fetch
- How to call a plugin function from a page
- If user is logged-in display/hide widgets ( siteorigine) [closed]
- Javascript not being loaded only in custom taxonomy template
- bindParam? WordPress 4.9.5 SQL LIKE statement %s and %LIKE%
- tweaking the
- User Registration Moderate
- external Integration with wordpress timeout error
- Implementing Select2 plugin into WordPress
- Problem to return more than single line captions
- Object Oriented plugin, add action and variables
- Why user is added back in database after deletion?
- Use plupload to upload images and save them to custom folder and database table
- add_action priority and taxonomy used in plugin
- How to add conent (text) to Add New pages form of admin in WordPress
- Tracing dashboard publish settings from input form in WordPress
- Post data in wp-admin to external database
- Images not displaying on live server
- redirect word-press page with page values
- How to do searching based on keywords added in page
- Open media box library from link
- How to only Load scripts on variable products page
- Using tag or inline style attribute?
- Forcing the Uninstall Hook to fail
- remove () from category number [closed]