in reply to CGI.pm and the missing cookie
I'm not certain if this is your problem, but you are not setting an expiration time... if you expect your cookie to persist after you close the browser that originally received it, it won't.
Again, I'm not sure this is the problem, just a quick observation,
-A