Don't confuse thi with Java. The two are very different. This works in Netscape and IE though. Keep in mind that the client can possibly see any of this code. They also may be less trusting of it, and disable it.
Cookies are another technology.
They are basically the client version of disk storage. Because they use storage space, and you can retrieve other sites cookies, this is generally frowned upon. MANY sites, however, use them to store customer unique information that can be retrieved later. Perhaps the easiest way to purchase this is as part of Back-Office. Sooner or later you will want everything else anyway, if you decide to go that route.