Do BBS and commercial website should often use, there is no reason to let users enter the password every time to log in. We need cookies to implement the automatic login feature:
01.function GetCookie (name) {
var start = document.cookie.indexOf (name + "=");
var len = start + name.length + 1;
if ((!start) && (name!= document.cookie.substring (0, name.length)) {
-Return null;
06.}
The. if (start = = 1) return null;
var end = Document.cookie.indexOf ('; ', Len);
if (end = = 1) end = Document.cookie.length;
Return unescape (document.cookie.substring (len, end));
11.}
12.function Setcookie (name, value, expires, path, domain, secure) {
var today = new Date ();
Today.settime (Today.gettime ());
if (expires) {
expires = expires * 1000 * 60 * 60 * 24;
17.}
var expires_date = new Date (Today.gettime () + (expires));
Document.cookie = name+ ' = ' +escape (value) +
((expires)? '; expires= ' +expires_date.togmtstring (): ') +//expires.togmtstring ()
(path)? ';p ath= ' + path: ') +
(domain)? ';d omain= ' + domain: ') +
(secure)? '; secure ': ';
24.}
25.function Deletecookie (name, path, domain) {
-if (GetCookie (name)) Document.cookie = name + ' = ' +
(path)? ';p ath= ' + path: ') +
(domain)? ';d omain= ' + domain: ') +
Expires=thu, 01-jan-1970 00:00:01 GMT ';
30.}