if(strlen($cookie_val) 4*1024){ trigger_error("The cookie $this- _name exceeds the specification for the maximum cookie size. Some data may be lost", E_USER_WARNING); } setcookie("$this- _name", $cookie_val, $this- _expires, $this- _dir, $this- _site); } } 希望本文所述对大家的PHP程序设计有所帮助。PHP教程