Some reader favorites:
EJB fundamentals and session beans
Create a scrollable virtual desktop in Swing
Wizard API updated!
Tim Boudreau has released a new version of the Swing Wizard library (version 0.997) that fixes the WizardException bug reported in JavaWorld's recent Open Source Java Project profile. The article's examples have been reworked to test out the new, improved WizardException. Thanks, Tim, for this helpful fix!
Open Source Java Projects: The Wizard API
TEXTBOX: TEXTBOX_HEAD: Take control of the servlet environment: Read the whole series!
Magical little pieces of data, cookies help a Web server identify and remember a particular Web browser. The first time a browser connects to the server, the server says, "Hi there! Here's a cookie for you, but don't eat it! Show me this cookie each time you come back to visit." Then, during all subsequent browser-to-server requests, the server can identify the visitor.
Behind the scenes, cookies are mapped to domains. Domains are, for the purposes of this discussion, Website addresses. For example, the domain for http://www.yahoo.com/ is www.yahoo.com. Actually, yahoo.com is the domain, and www is a subdomain; herein lies the problem. Cookies are actually mapped to the full path -- domain and subdomain -- and subdomains can go deeper than one layer, for example http://us.f36.mail.yahoo.com/ or http://lw3fd.law3.hotmail.msn.com/.
But why does this present a problem? Suppose you have a visitor surfing your Website at http://www.rudiment.net/. Any cookies that you send to the browser will map to www.rudiment.net. For the purposes of organization, you have segregated a portion of your site at the address http://members.rudiment.net/. As a visitor bounces back and forth between the two addresses, the server cannot share the cookie values. This behavior resembles scope or namespaces in programming. A cookie named "session" might exist in both the www cookie and the members cookie under the rudiment.net domain, with each instance being unique.
But wait, it gets worse. Suppose the user types http://www.members.rudiment.net/ into his or her browser. Assuming that you have this subdomain mapped to http://members.rudiment.net (or your DNS is configured for wildcards) and your Webpages use relative links (both topics beyond the scope of this article), the cookies are now written to the www.members version of the rudiment.net domain instead of the normal www, as the figure below illustrates.

Cookies map to domain and subdomain
Two major problems result:
First, you cannot access any data that you write to the browser at the www.members subdomain if the visitor returns later to the members address. When the browser passes a cookie back to the server, it passes only the values stored in the lowest-level subdomain of the request.
Free Download - 5 Minute Product Review. When slow equals Off: Manage the complexity of Web applications - Symphoniq
![]()
Free Download - 5 Minute Product Review. Realize the benefits of real user monitoring in less than an hour. - Symphoniq