<?php

error_reporting(E_ALL);

/** 
* Proxy function for 'setcookie' 
* @param $cookieName	- Name of the cookie
* @param $cookieValue	- Value of the cookie
* @param $expires		- Time the cookie will be expired
* @return void
*/ 
function saveCookie($cookieName='', $cookieValue='', $expires=0)
{
	print "Save Cookie\n";
	
	if($cookieName == "")
	{
		print "Name not provided, cookie not saved\n";
	}
	if($cookieValue == "")
	{
		print "Value not provided, cookie not saved\n";
	}
	
	setcookie($cookieName, $cookieValue, $expires);
}

$username = "jimmy";
$userID = 5;
$loggedInTime = time();

saveCookie(); // force a bad call

//saveCookie("username", $username);
//saveCookie("userid", $userID);
//saveCookie("logged_in_since", $loggedInTime);

saveCookie('test', 'value', time());

?>