--- includes/locale_cookie.inc	Thu Aug 11 16:25:22 2011
+++ includes/locale_cookie.inc	Tue Aug 27 13:08:22 2013
@@ -27,10 +27,15 @@
       $langcode = $language->language;
     }
     else {
       $langcode = language_default('language');
     }
   }
   $expire = REQUEST_TIME + (86400 * variable_get('locale_cookie_language_negotiation_cookie_expire', 7));
-  setcookie($param, $langcode, $expire, $base_path);
+  $path = variable_get('locale_cookie_language_negotiation_cookie_path', $base_path);
+  $domain = variable_get('locale_cookie_language_negotiation_cookie_domain', '');
+  $secure = variable_get('locale_cookie_language_negotiation_cookie_secure', FALSE);
+  $http_only = variable_get('locale_cookie_language_negotiation_cookie_http_only', FALSE);
+  
+  setcookie($param, $langcode, $expire, $path, $domain, $secure, $http_only);
   return $langcode;
 }

--- locale_cookie.admin.inc	Thu Aug 11 16:25:22 2011
+++ locale_cookie.admin.inc	Tue Aug 27 13:07:49 2013
@@ -1,24 +1,61 @@
 <?php
 
 /**
  * The URL language provider configuration form.
  */
 function locale_cookie_language_providers_cookie_form($form, &$form_state) {
+  global $base_path;
+  
   $form['locale_cookie_language_negotiation_cookie_param'] = array(
-    '#title' => t('Request/cookie parameter'),
+    '#title' => t('Cookie name'),
     '#type' => 'textfield',
     '#default_value' => variable_get('locale_cookie_language_negotiation_cookie_param', 'language'),
     '#description' => t('Name of the request/cookie parameter used to determine the desired language.'),
   );
 
   $form['locale_cookie_language_negotiation_cookie_expire'] = array(
-    '#title' => t('Expire'),
+    '#title' => t('Cookie expire'),
     '#type' => 'textfield',
     '#default_value' => variable_get('locale_cookie_language_negotiation_cookie_expire', 7),
     '#description' => t('The time (in days) in which the cookie should expire.'),
   );
 
-  $form_state['redirect'] = 'admin/config/regional/language/configure';
+  $form['locale_cookie_language_negotiation_cookie_path'] = array(
+    '#title' => t('Cookie path'),
+    '#type' => 'textfield',
+    '#default_value' => variable_get('locale_cookie_language_negotiation_cookie_path', $base_path),
+    '#description' => t('The path on the server in which the cookie will be available on.'),
+  );
 
+  $form['locale_cookie_language_negotiation_cookie_domain'] = array(
+    '#title' => t('Cookie domain scope'),
+    '#type' => 'textfield',
+    '#default_value' => variable_get('locale_cookie_language_negotiation_cookie_domain', ''),
+    '#description' => t('The domain that the cookie is available to.'),
+  );
+  
+  $form['locale_cookie_language_negotiation_cookie_secure'] = array(
+    '#title' => t('Cookie secure'),
+    '#type' => 'radios',
+    '#default_value' => variable_get('locale_cookie_language_negotiation_cookie_secure', FALSE),
+    '#options' => array(
+      0 => t('Disabled'),
+      1 => t('Enabled')
+    ),
+    '#description' => t('When this option is set to "Enabled" the cookie should be only transmitted over a secure HTTPS connection from the client. The cookie will only be set if a secure connection exists.'),
+  );
+  
+  $form['locale_cookie_language_negotiation_cookie_http_only'] = array(
+    '#title' => t('Cookie HTTP only'),
+    '#type' => 'radios',
+    '#default_value' => variable_get('locale_cookie_language_negotiation_cookie_http_only', FALSE),
+    '#options' => array(
+      0 => t('Disabled'),
+      1 => t('Enabled')
+    ),
+    '#description' => t('When this option is set to "Enabled" the cookie will be made accessible only through the HTTP protocol. This means that the cookie won\'t be accessible by scripting languages, such as JavaScript. It has been suggested that this setting can effectively help to reduce identity theft through XSS attacks.'),
+  );
+  
+  $form_state['redirect'] = 'admin/config/regional/language/configure';
   return system_settings_form($form);
 }

--- locale_cookie.module	Thu Aug 11 16:25:22 2011
+++ locale_cookie.module	Tue Aug 27 13:08:27 2013
@@ -19,15 +19,20 @@
       $langcode = $_COOKIE[$param];
     }
   }
   else {
     $langcode = $language->language;
   }
   $expire = REQUEST_TIME + (86400 * variable_get('locale_cookie_language_negotiation_cookie_expire', 7));
-  setcookie($param, $langcode, $expire, $base_path);
+  $path = variable_get('locale_cookie_language_negotiation_cookie_path', $base_path);
+  $domain = variable_get('locale_cookie_language_negotiation_cookie_domain', '');
+  $secure = variable_get('locale_cookie_language_negotiation_cookie_secure', FALSE);
+  $http_only = variable_get('locale_cookie_language_negotiation_cookie_http_only', FALSE);
+  
+  setcookie($param, $langcode, $expire, $path, $domain, $secure, $http_only);
 }
 
 function locale_cookie_language_negotiation_info() {
   $file = drupal_get_path('module', 'locale_cookie') . '/includes/locale_cookie.inc';
   $providers[LOCALE_COOKIE_NEGOTIATION_COOKIE] = array(
     'types' => array(LANGUAGE_TYPE_CONTENT, LANGUAGE_TYPE_INTERFACE, LANGUAGE_TYPE_URL),
     'callbacks' => array(