<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">
<Html>
<Head>
<Title> New Document </title>
<Meta name = "Generator" content = "EditPlus">
<Meta name = "Author" content = "">
<Meta name = "Keywords" content = "">
<Meta name = "Description" content = "">
</Head>
<Body>
<Script language = "JavaScript" type = "text/javascript">
<! --
// Set two cookies
Document. cookie = "userId = 828 ";
Document. cookie = "userName = hulk ";
// Obtain the cookie string
Var strCookie = document. cookie;
// Cut multiple cookies into multiple name/value pairs
Var arrCookie = strCookie. split (";");
Var userId;
// Traverse the cookie array to process each cookie pair
For (var I = 0; I <arrCookie. length; I ++ ){
Var arr = arrCookie [I]. split ("= ");
// Find the cookie named userId and return its value
If ("userId" = arr [0]) {
UserId = arr [1];
Break;
}
}
Alert (userId );
// -->
</Script>
</Body>
</Html>