$cookie_name = "IP: "; $cookie_value = $_SERVER['REMOTE_ADDR']; setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); // 86400 = 1 day ?>