PHP-функция: setcookieСписок php-функций

javascript:

function setcookie(name, value, expires, path, domain, secure) {
	// Send a cookie
	// 
	// +   original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)

	expires instanceof Date ? expires = expires.toGMTString() : typeof(expires) == 'number' && (expires = (new Date(+(new Date) + expires * 1e3)).toGMTString());
	var r = [name + "=" + escape(value)], s, i;
	for(i in s = {expires: expires, path: path, domain: domain}){
		s[i] && r.push(i + "=" + s[i]);
	}
	return secure && r.push("secure"), document.cookie = r.join(";"), true;
}

//Примеры:

alert ( setcookie('author_name', 'Kevin van Zonneveld') );