$this->Application->Session->SetCookie('save_username',$save_username,adodb_mktime()+31104000);// 1 year expiration
$this->Application->SetVar('save_username',$save_username);// cookie will be set on next refresh, but refresh won't occur if login error present, so duplicate cookie in HTTPQuery
$fields['Country']['options_sql']=preg_replace('/ORDER BY (.*)/','ORDER BY IF (DestId = '.$first_country.', 1, 0) DESC, \\1',$fields['Country']['options_sql']);