<?php
$_GET = array_map("trim",$_GET); 
$get = isset($_GET['act'])||!empty($_GET['act'])?$_GET['act']:'get';
switch ($get){
	case 'set':
		$value = $_GET['value'];
		$key = $_GET['key'];
		if(!empty($key)){
			setcookie($key,$value,time()+3600,'/');
		}
		break;
	case 'get':
		$key = $_GET['key'];
		if(!empty($key))echo $_COOKIE[$key];
		break;
	default:exit('0');
}
?>