Skip to content

Instantly share code, notes, and snippets.

@AustinWinstanley
Last active April 10, 2017 21:32
Show Gist options
  • Save AustinWinstanley/cddd922ff982d0284270b60f70f657df to your computer and use it in GitHub Desktop.
Save AustinWinstanley/cddd922ff982d0284270b60f70f657df to your computer and use it in GitHub Desktop.
Shared user tables and cookies between sites #WordPress
/**
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
//
// Use same Keys and Salts for both sites
//
/**
* WordPress Database Table prefix.
*
* You can have multiple installations in one database if you give each
* a unique prefix. Only numbers, letters, and underscores please!
*/
$table_prefix = 'wp_'; // Primary site only
// $table_prefix = 'ac_'; // Secondary site only
/**
* Everything below must be done on in primary and secondary wp-config.php with same values in both
*/
/** Primary User table */
define('CUSTOM_USER_TABLE','wp_users');
/** Primary User Meta table */
define('CUSTOM_USER_META_TABLE','wp_usermeta');
/** Base path */
define('COOKIEPATH', '/');
define('SITECOOKIEPATH', '/');
/** Primary site domain with leading '.' */
define('COOKIE_DOMAIN', '.example.com');
/** Shared cookie hash */
$cookiehash = md5("https://example.com/");
/** Cookie hash */
define('COOKIEHASH', $cookiehash );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment