name :name
expires: date
path :path
domain:URL where cookie matches
secure:true/falseis used to ask whether to transfer data.
excape:converts to Unicode format.
toGMTString():returns the date converted to string using Greenwich Mean Time.
1) Cookie creation example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>cookie</title>
<script type="text/javascript">
//<![CDATA[
var cookieName="pop_chk";
var cookieValue="pop2010";
today=new Date();
today.setDate(today.getDate()+1);
document.cookie=cookieName+ "=" +escape(cookieValue)+ "; path=/; expires=" +today.toGMTString()+ ";";
// load cookie
document.write(document.cookie+"<br />");
//]]>
</script>
</head>
<body>
Cookie creation complete.
Tools > Internet Options > Settings > View Files > Last modified date (recent)
</body>
</html>
2) Loading a cookie created in another document, from another document
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>cookie</title>
<script type="text/javascript">
//<![CDATA[
// load cookie
document.write(document.cookie+"<br />");
//]]>
</script>
</head>
<body>
Cookie creation complete.
Tools > Internet Options > Settings > View Files > Last modified date (recent)
위에 스크립트를 보면 쿠키 생성을 안했지만 쿠키는 로컬에 저장되기 때문에
they can be loaded from external documents.
</body>
