§ÚÌ°£¤F¥i¥H³]©w Cookie ¤§¥~¡A·íµM¤]¥i¥H¹ï Cookie ¶i¦æ§R°£¡Bקï©Î¬d¸ßµ¥°Ê§@¡A¤U¦C½d¨Ò´N¬O¤@Ó¡u¤p»æ°®¸ÕÅç³õ¡v¡A¥¦¤Þ¥Î¤F cookieUtility.js ¤ºªº¨ç¼Æ¨Ó¹ï Cookie ¶i¦æ·s¼W¡Bקï¡B§R°£ªº¦UºØ°Ê§@¡G¤Wz½d¨Òªºì©lÀɦp¤U¡G
¦b¤Wz½d¨Ò¤¤¡A§ÚÌ©I¥s¤F´XÓ¨ç¼Æ¡]setCookie(), delCookie(), getCookie()µ¥¡^¨Ó¹ï Cookie ¶i¦æ³B²z¡A³o¨Ç¨ç¼Æ§¡©w¸q©ó cookieUtility.js ¤§¤¤¡A¥Ñ©ó½g´T¦³¡A½Ð¨£«e¤@¤p¸`ªºì©l½X¦Cªí¡A¦b¦¹¤£¦A«½Æ¡C¯S§Onª`·Nªº¬O¡A·í§ÚÌn§R°£¤@Ó Cookie¡A³q±`ªº§@ªk¬O³]©w¨ä¥¢®Ä¤é´Á¡A¥un¥¢®Ä¤é´Á¬O¦©ó²{¦bªº®É¶¡¡ACookie ´N·|³Q§R°£¤F¡A¦b cookieUtility.js ¤¤ªº delCookie() ¨ç¼Æ¡A´N¬O¥H¦¹¤èªk¶i¦æ¹ê§@¡A¦¹¨ç¼Æªºµ{¦¡½X¦p¤U¡G
// Delete cookie entry function delCookie(name) { var expDate = new Date(); expDate.setTime(expDate.getTime()-1); // ³]©w Cookie ªº¥¢®Ä®É¶¡¤ñ¥Ø«e®É¶¡ÁÙ¦ document.cookie = escape(name) + "=; expires=" + expDate.toGMTString(); // «·s³]©w Cookie } ¦b«e¤@Ó½d¨Ò¤¤¡A¥Ñ©ó¦b³]©w Cookie ®É¡A¨S¦³«ü©w¨äªº´Á¡A¦]¦¹ Cookie ¥u³Q¦s©ñ¦b°O¾ÐÅ餤¡AY¨Ï¥ÎªÌÃö³¬©Ò¦³ÂsÄý¾¹µøµ¡¡ACookie ªº¸ê®Æ±NÀH¤§®ø¥¢¡C¡]½Ð¸Õ¸Õ¬Ý¡I¡^Y¨Ï¥ÎªÌ¤£¦A¦s¨ú¸Óºô¶¡A«h Cookie ¤]·|¦b Session Time-out ¡]¥Ñ¦øªA¾¹³]©w¡A³q±`¬O 20 ¤ÀÄÁ¡^«á´N®ø¥¢¡C
Yn¨Ï Cookie ¯àºû«ùªø¤[ªº®Ä¤O¡A´N¥²¶·³]©w Cookie ªº¥¢®Ä¤é´Á¡]Expiration date¡^¡C´«¥y¸Ü»¡¡A¦b¦¹¥¢®Ä¤é´Á«e¡ACookie ³£¬O¦³®Äªº¡A¨Ã·|¦bÂsÄý¾¹¸ü¤Jºô¶®É¡A¦s©ñ©ó document.cookie¡AYÂsÄý¾¹Ãö³¬¡A«h·s¼Wªº Cookie ¡]±a¦³¯S©wªº¥¢®Ä¤é´Á¡^·|³Q¦s©ñ¨ì¯S©wªºÀɮפ¤¡CCookie ¦s©ñªºÀɮסA¦b Netscape ¬O cookies.txt¡A¦b IE «h¬O¦b Cookies ¥Ø¿ý¤§¤U¡C±ý±oª¾³o¨ÇÀɮשΥؿýªº¹êÅé¸ô®|¡A½Ðª½±µ¶i¦æ¡u´M§äÀɮסv§Y¥i¡C
¦b¤U¦C½d¨Ò¤¤¡A§Ų́ϥΠCookie ¨Ó°O¿ý¨Ï¥ÎªÌ³y³Xºô¶ªº¦¸¼Æ¡G
¤Wz½d¨Òªºì©lÀɦp¤U¡G
¦b¤Wz½d¨Ò¤¤¡A³y³Xºô¶ªºp¼Æ¸ê®Æ¬O¦s©ñ¦b¦W¬° VisitCount ªº Cookie ¤§¤¤¡A¦¹ Cookie ªº¦³®Ä´Á¶¡¬O¤@¦~¡A¦]¦¹¨Ã¤£·|ÀHµÛÂsÄý¾¹ªºÃö³¬¦Ó®ø¥¢¡C¡]½Ð¸Õ¸Õ¬Ý¡I¡^
¥t¥~¡A¦b¦P¤@ӥؿý¤Uªººô¶¡A°ò¥»¤W¥i¥H¦@¥Î Cookie ªº¸ê°T¡C´«¥y¸Ü»¡¡A¥un cookie02.htm ©M cookie03.htm ¬O¦ì©ó¦P¤@ӥؿý¡A§A¥i¥H¦b cookie02.htm ³]©w¤@Ó Cookie¡AµM«á¦b cookie03.htm ªº Cookie ¦Cªí¬Ý¨ì¤§«e³]©wªº¸ê®Æ¡C
JavaScript µ{¦¡³]p»PÀ³¥Î¡G¥Î©óºô¶¥Î¤áºÝ