Below are seven different variants of the classical hangman game, each one of which maintains state in a different fashion. This version of the game keeps a running score of everyone who's used it, and should be the one to use if you're just looking to play. This version of the game maintains its state in hidden fields. Performance is great and the script is very simple, but it's ridiculously easy to cheat. This version maintains state with a cookie.
Performance is still good and it's a little harder to cheat, but still possible.
The user can still peak at the secret word, however. This version encrypts the cookie so that it can't be read or tampered with. The session ID is kept in a cookie. To keep memory usage under control, only 100 simultaneous sessions are allowed, with the oldest sessions deleted as needed. This version stores the state information in a mySQL database and stashes the session ID in a cookie.