Thanks a lot for everybody's help. I changed over to using CGI rather than CGI::Cookie and I also changed to use
and now everything looks like it's working fine. I don't know it seemed to be working before, that's weird.
btw, I'm not sending the password in the cookie, it's another string that just identifies the user. I only call it userpass since in my original code I was sending the password. I've learned the error of my ways though.