Cookies are small text files that enable web applications to maintain state and personalize user experiences, with Java providing mechanisms for their creation, management, and security. They can be used for persistent data storage and session management, as well as personalization and security. Proper practices in handling cookies include setting properties, retrieving cookie data, and ensuring security through HTTPS and appropriate flags.