Hi,
the cookieDomain variable is used for sending to javascript the domain in which the cookie will be stored. Currently its value would be the COOKIE_DOMAIN constant if it exists, or an empty string otherwise.
I would like to suggest to give users the opportunity to customize the cookieDomain value before it will be sended to javascript (via wp_localize_script).
In some situations, (like in a multisite environment) this could leads to some troubles if the COOKIE_DOMAIN constant is already defined by the user, for example in wp-config.php.
To be more specific, if the COOKIE_DOMAIN value is different from the current domain in the client's browser the cookie will no more recognized by the $_COOKIE and the plugins does not work.
Consider that this could be a real scenario in a multisite environment with domains mapped to subdomains.
The following could be an easy implementation of the feature request that could be definitely resolve the issue:
'cookieDomain' => apply_filters( 'cn_cookie_domain', ( defined( 'COOKIE_DOMAIN' ) ? COOKIE_DOMAIN : '' ) )
Hi,
the
cookieDomainvariable is used for sending to javascript the domain in which the cookie will be stored. Currently its value would be theCOOKIE_DOMAINconstant if it exists, or an empty string otherwise.I would like to suggest to give users the opportunity to customize the
cookieDomainvalue before it will be sended to javascript (viawp_localize_script).In some situations, (like in a multisite environment) this could leads to some troubles if the
COOKIE_DOMAINconstant is already defined by the user, for example inwp-config.php.To be more specific, if the
COOKIE_DOMAINvalue is different from the current domain in the client's browser the cookie will no more recognized by the $_COOKIE and the plugins does not work.Consider that this could be a real scenario in a multisite environment with domains mapped to subdomains.
The following could be an easy implementation of the feature request that could be definitely resolve the issue:
'cookieDomain' => apply_filters( 'cn_cookie_domain', ( defined( 'COOKIE_DOMAIN' ) ? COOKIE_DOMAIN : '' ) )