Why cant I change cookie?
If you chose a language you cant change. You have to empty your cookies if you want to change language. Why is that?
if (isset($_GET['setLang']) && $_GET['setLang'] == 'en'
|| isset($_COOKIE['setLang']) && $_COOKIE['setLang'] == 'en') {
setcookie("setLang", 'en', time()+(3600*12)); //expires in 12 hours
include('language/en/common.php');
}
elseif (isset($_GET['setLang']) && $_GET['setLang'] == 'se'
|| isset($_COOKIE['setLang']) && $_COOKIE['setLang'] == 'se') {
setcookie("setLang", 'se', time()+(3600*12)); //expires in 12 hours
include('language/se/common.php');
}
else if (isset($_GET['setLang']) && $_GET['setLang'] == 'fr'
|| isset($_COOKIE['setLang']) && $_COOKIE['setLang'] == 'fr') {
setcookie("setLang", 'fr', time()+(3600*12)); //expires in 12 hours
include('language/fr/common.php');
}
// default language is english
else {
include('language/en/common.php');
}