I added some changes to allow configurable cookie domain scope. Modified .module file in attachment

Comments

codium’s picture

Suggest changes to make in language_cookie.admin.inc

  $form['language_cookie_path'] = array(
    '#title' => t('Cookie path'),
    '#type' => 'textfield',
    '#default_value' => variable_get('language_cookie_path', '/'),
    '#description' => t('The cookie available server path'),
  );

  $form['language_cookie_domain'] = array(
    '#title' => t('Cookie domain scope'),
    '#type' => 'textfield',
    '#default_value' => variable_get('language_cookie_domain', ''),
    '#description' => t('The cookie domain scope'),
  );

in language_cookie.module

function language_cookie_set($lang = NULL) {
  if (!$lang) {
    global $language;
    $lang = $language->language;
  }

  $cookie = new stdClass;
  $cookie->name = variable_get('language_cookie_param', 'language');
  $cookie->value = $lang;
  $cookie->expire =  variable_get('language_cookie_time', 31536000);
  $cookie->path = variable_get('language_cookie_path', '/');
  $cookie->domain = variable_get('language_cookie_domain', '');
  $cookie->secure = false;
  $cookie->httponly = false;

  #allow other modules to change the cookie
  drupal_alter('language_cookie', $cookie);

  setrawcookie(
    $cookie->name,
    rawurlencode($cookie->value),
    REQUEST_TIME + $cookie->expire,
    $cookie->path,
    $cookie->domain,
    $cookie->secure,
    $cookie->httponly
  );
}
codium’s picture

Assigned: Unassigned » codium
codium’s picture

Category: feature » task
Status: Needs review » Patch (to be ported)
StatusFileSize
new1.1 KB
new921 bytes
alexweber’s picture

Status: Patch (to be ported) » Fixed

Fixed in 219a898 and 952fd0b.

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.