Verification of cookie

I use a protection of my page by login/password and i use cookie for verify witch type of user it and redirect them on differents pages.
In local with Wamp, there is no problem but online, if cookie paramlog is not find, the error page is not the well done page and parameter erreur_msg is not send.

The destination page :

/ / verify type of user and redirect.
setcookie(“redirect”,"/param.php",0,"/");
setcookie(“log”,“3”,0,"/");
needs_login($paramlog,"/index.php?erreur_msg=$erreur_msg_param");

and the redirect if not login :

if ( !defined( “_NEEDS_LOGIN” ) ) {
define("_NEEDS_LOGIN", 1 );

  function needs_login($cookie,$error_url) {
  	if ($cookie != 1)
  	{
  		if ($error_url=="") 
  		{
  			$error_url="/index.php";
  		}
  		Header("Location: $error_url");
  	} else {
  		setcookie("redirect","/index.php",0,"/");
  	}
  }

}

Could you help me please.