I would appreciate some advice on a PHP coding issue I have on a website (proprietary CMS). The issue began after the site was migrated to a new server, and the original devs are not being helpful to this end. The current host already tried doing a number of things to fix this issue, like adjusting the server settings to match the previous one, which resolved many issues but left some bugs.
There is an issue with session cookies not being accepted, which results in the user not being able to change the region/languages manually on the site. We modified the code to try and fix them (they were expired years ago, but the expired cookies did function on the old server), but even then it's not working. This is the code snippet below:
Code: Select all
public function setLanguage($lang) {
if(in_array($lang, array_keys($this->_avalLangs))) {
$this->_language = $lang;
$langCookie = new CHttpCookie('language', $this->_language);
$langCookie->domain = $_SERVER['SERVER_NAME'];
$langCookie->expire = time()+64000000000;
$c = new CCookieCollection($this->_request);
$c->add('language', $langCookie);
} else {
$this->_language = $this->_getDefaultLanguage();
}
}