Trình duyệt này sử dụng thời hạn sử dụng để xác định khi các cookie được lưu trữ phải được tiêu huỷ. Nếu ngày được thiết lập trong tương lai, trình duyệt sẽ giữ các cookie cho đến ngày quy định. Nếu cookie được thiết lập trong quá khứ, sau đó trình duyệt sẽ ngay lập tức xử lý cookie. | SETTING UP A COOKIE 69 The browser uses the expiry date to identify when the stored cookie should be destroyed. If the date is set in the future the browser will keep the cookie until the specified date. If the cookie is set in the past then the browser will immediately dispose of the cookie. Setting a value of zero will cause the cookie only to be retained until the browser quits so the cookie is never actually written to the hard disk. The expiry information can be specified either explicitly or relatively. For example you might want to create a cookie for a user s login process that expires in three months time. You don t need to manually calculate the value a relative expiry date is calculated from the time the cookie is generated. You can see a list of the supported date formats in the table. Expiry Description 10y Expires in ten years. 3M Expires in three months. 1h Expires one hour in the future. 10m Expires ten minutes in the future. 30s Expires 30 seconds from the time of creation. Now Expires when the user s browser quits. Thursday 25-Apr-1999 00 40 33 GMT Expires at the specified date and time. -1d Expires immediately. The domain is the partial or complete domain name for which the cookie is valid. The browser uses the domain field to determine where to send the cookie. The value of the domain can be a specific machine such as or a partial domain such as .. The latter is useful for installations where multiple servers return information but need to provide authorization across all of them. Note that domains must contain at least two periods. The path is a further classification for the browser to use when determining when the cookie should be sent to the server. If left unspecified the cookie 70 CGI TRICKS data will be sent with any page request. However it s normal to specify the path to your CGI scripts directory. For example if set to cgi-bin the cookie data will only be sent with requests for files within the cgi-bin .