ms_cookie_constants()

Defines Multisite cookie constants.


Source

File: wp-includes/ms-default-constants.php

function ms_cookie_constants(  ) {
	$current_network = get_network();

	/**
	 * @since WP-1.2.0
	 */
	if ( !defined( 'COOKIEPATH' ) )
		define( 'COOKIEPATH', $current_network->path );

	/**
	 * @since WP-1.5.0
	 */
	if ( !defined( 'SITECOOKIEPATH' ) )
		define( 'SITECOOKIEPATH', $current_network->path );

	/**
	 * @since WP-2.6.0
	 */
	if ( !defined( 'ADMIN_COOKIE_PATH' ) ) {
		if ( ! is_subdomain_install() || trim( parse_url( get_option( 'siteurl' ), PHP_URL_PATH ), '/' ) ) {
			define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH );
		} else {
			define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' );
		}
	}

	/**
	 * @since WP-2.0.0
	 */
	if ( !defined('COOKIE_DOMAIN') && is_subdomain_install() ) {
		if ( !empty( $current_network->cookie_domain ) )
			define('COOKIE_DOMAIN', '.' . $current_network->cookie_domain);
		else
			define('COOKIE_DOMAIN', '.' . $current_network->domain);
	}
}


Changelog

Changelog
Version Description
WP-3.0.0 Introduced.