<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sitesnippet SYSTEM "sitesnippet.dtd">
<!--Adobe GoLive snippet file-->
<snippet version="1.0" title="写 cookie" type="HTML" author="Transmit Media for Adobe Systems, Inc." description="用于写入一个带有过期日期的简单 cookie 的函数。">
	<markupsource>
		<![CDATA[
// Call the function elsewhere to write the cookie
// Example: writeCookie("myCookie", "myName");
// Stores the string "myName" in the cookie "myCookie"

function writeCookie(name, value)
{
	var expire = "";
	//Set the expiration date below
	expire = new Date("January 1, 2004");
	expire = "; expires=" + expire.toGMTString();
  
  	document.cookie = name + "=" + escape(value) + expire;
}]]>
	</markupsource>
</snippet>