Cookies
Since the HTTP (HyperText Transport Protocol) protocol cannot maintain user information, cookies are a solution to save useful client side data. The implementation varies on different browsers, but we decided to use the Netscape convention, because this great enterprise developed JavaScript. Netscape Navigator holds cookies in a text file called cookies.txt; otherwise, Microsoft Internet Explorer saves them into the Cookies folder. The implementation we present is Navigator and Explorer compliant.
Notice each cookie is attached in the cookies.txt file as a line and it has the following format
name=value;expires=expirationDate;
name is the name of the cookie and value, its value. expirationDate is an optional parameter, which indicates the cookie lifetime. expirationDate, if available, has the following structure
Mon, DD-MM-YY HH:MM:SS GMT
We use the toGMTString method, belonging to the Date object, to convert dates to this format. We remarked expirationDate is an optional parameter. When it is not set up, it is removed when user exits the current browser session. When its expiration date is explicited, cookie is not deleted until this date.Cookies