Cookies Manager Class Example/Documentation

Including

Include class.CookiesManager.php on the page where you want to use the class.

				include("class.CookiesManager.php");
			

Examples

Your PHP code
$cookies = New CookiesManager();

// Setting a cookie for 1 minute
$cookies->set("MyName", "Peter", 1, "minute");

// Setting a cookie for 30 minutes
$cookies->set("MyName", "Peter", 30, "minutes");

// Setting a cookie for 9 hours
$cookies->set("MyName", "Peter", 9, "hours");

// Setting a cookie for 10 calendar days
$cookies->set("MyName", "Peter", 10, "days");

// Setting a cookie for 3 calendar weeks
$cookies->set("MyName", "Peter", 3, "weeks");

// Setting a cookie for 5 calendar months
$cookies->set("MyName", "Peter", 5, "months");

// Setting a cookie for 2 calendar years
$cookies->set("MyName", "Peter", 2, "years");

// Destroy a cookie
$cookies->destroy("MyName");

// Destroy all cookies
$cookies->destroy_all();

// Returns the amount of cookies
$cookies->count();