-
Notifications
You must be signed in to change notification settings - Fork 46
Description
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 : '' ) )