Not that I don't agree that the website logs you out again a bit too fast, but I want to get a better grasp of how to actually do such a thing in a secure manner before attempting it. Leaving behind a lot of residual authorization cookies like most websites do is not something I fancy very much from that point of view.
The forums should be holding you logged in for much longer, for that matter. Do you find that is not the case? If you merely speak of it for logging into the game, you may want to use the more static client at
http://www.havenandhearth.com/java/haven.jnlp, since the client already allows you to save login credentials in an actually secure manner, and that client is launchable without logging on with the website.