[php] Could not set cookie in IE7


I am using PHP to store cookies which will remember the user’s language. Users are also allowed to change their language by clicking their country’s flag (circled in pink), and the change will be reflected in the cookie. Everything works fine in Firefox, but on IE7 the cookie is stuck on “english”. Debugging code is circled in pink on the bottom of the screeenshot.

BTW, I have two language variables, because the cookie language variable sometimes does not reflect the language the user is changing to. Recall that cookie variables only update when the PHP page is refreshed.

$language1 = $_GET['language'];
$language2 = $_COOKIE['language'];

// first time user - default to english
	setcookie('language', 'english', time() + 25920000);

// changing to a different language
else if(($language1 == 'german') || ($language1 == 'english'))
	setcookie('language', $language1, time() + 25920000);