diff --git a/locale_cookie.module b/locale_cookie.module
index faee289..1492a58 100644
--- a/locale_cookie.module
+++ b/locale_cookie.module
@@ -11,8 +11,7 @@ define('LOCALE_COOKIE_NEGOTIATION_COOKIE', 'language-cookie');
  * Implements hook_init().
  */
 function locale_cookie_init() {
-  global $base_path;
-  global $language;
+  global $base_path, $language, $cookie_domain;
   $param = variable_get('locale_cookie_language_negotiation_cookie_param', 'language');
   if (isset($_COOKIE[$param])) {
     if (is_object($language) && $_COOKIE[$param] != $language->language) {
@@ -26,7 +25,7 @@ function locale_cookie_init() {
     $langcode = $language->language;
   }
   $expire = REQUEST_TIME + (86400 * variable_get('locale_cookie_language_negotiation_cookie_expire', 7));
-  setcookie($param, $langcode, $expire, $base_path);
+  setcookie($param, $langcode, $expire, $base_path, $cookie_domain);
 }
 
 /**
