I am facing problem with setcookie(), its working fine on localhost but not on Server, this issue happened when I changed Unicode for all my webpages and database to utf-8. the following is snippet of my code:
if(isset($_GET['langid'])) {
$langID = $_GET['langid'];
setcookie('langid', $langID);
}
elseif (isset($_COOKIE['langid'])) {
$langID = $_COOKIE['langid'];
echo $_COOKIE['langid'];
}
else {
$langActive=mysql_query("SELECT * FROM languages WHERE id=2 AND active=2");
$langActive=mysql_fetch_array($langActive);
if (empty($langActive)){ $langID = 0;}
else{ $langID = 2; }
}