<?php
	function newcookie($name, $value) {
	setcookie($name, $value, 0, "/", $_SERVER["HTTP_HOST"], 0);
	}

	function delcookie($name) {
	setcookie($name, "", time()-60, "/", $_SERVER["HTTP_HOST"], 0);
	}

while($user_check = mysql_fetch_array($db_cookis)) {

	if (isset($_COOKIE[com]) && $_COOKIE[com] == "1") {

 if (isset($_COOKIE[user]) && $_COOKIE[user] == $user_check[bruger]) {

if (isset($_COOKIE[pass]) && $_COOKIE[password] == md5($user_check[kodeord])) {

newcookie("com", "1");
newcookie("user", $user_check[bruger]);
newcookie("pass", md5($user_check[kodeord]));
newcookie("pycoins", "ja");
setcookie("inactive", "yes", time()+1200, 0, $_SERVER["HTTP_HOST"], 0);
setcookie("timein", "yes", time()+3600, 0, $_SERVER["HTTP_HOST"], 0);

}//slutter forespørgsel om kodeord cookien

delcookie("com");
delcookie("user");
delcookie("pass");

}//slutter forespørgsel om bruger cookien

delcookie("com");
delcookie("user");
delcookie("pass");
}//slutter forespørgsel om com cookien

}//slutter while
?>