COOKIE function library: cookie.inc.php3
if (!isset($__cookie_inc__)){
$__cookie_inc__=1;
function JsSetCookie($CName,$ CValue,$CExpr=FALSE){
// This function allows you to set cookies after the HTML header tag.
// It can be used as a supplement to the SetCookie function or even as a replacement.
// $CName....: The name of the cookie
// $CValue....: The value of the cookie
// $CEXpr....: The validity period of the cookie, in minutes as the unit, you can also modify and add hours, days
if($CExpr > 0){
$CookieString="astr= '$CName' + '=' + '$CValue' + '; expires=' + expr + ';path=/';";
$Cookie.="nn";
}else{
$Cookie.="nn";
}
echo $Cookie;
}
}
?>
Original author: Unknown