Có gì trong một cookie? Bảng liệt kê 18.3 cho thấy một ví dụ, và niêm yết 18,4 cho thấy mã mà tạo cookie này.
BigFood a% 20very% 20big% 20cookie www.evil-spirit.com/ 0 1334000384 31.689.671 678.306.528 29.486.907 *
niêm yết 18,3 Một ví dụ về dữ liệu cookie. Niêm yết 18,4 Các mã nguồn cho cookie trong Liệt kê 18.3.
// // Cookie Functions - Second Helping (21-Jan-96) // Written by: Bill Dortch, Idaho Design // The following functions are released to the public domain. // // Please refer to the official cookie spec, at: // // http://www.netscape.com/newsref/std/cookie_spec.html // // SetCookie (myCookieVar, cookieValueVar, null, “/myPath”, null, true); // function SetCookie (name, value) { var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; document.cookie = name + “=” + escape (value) + ((expires == null) ? “” : (“; expires=” + expires.toGMTString())) + ((path == null) ? “” : (“; path=” + path)) + ((domain == null) ? “” : (“; domain=” + domain)) + ((secure == true) ? “; secure” : “”); }
đang được dịch, vui lòng đợi..
