You're not telling us very much that we need to know to help you out. Are you using
LWP to handle the connections? IIRC that module handles basic HTTP authentication and cookies quite well. When you say "sock session" I get the impression you are doing socket level work yourself, which is definitely a big waste of time if you are connecting to standard web servers. It would be helpful if you gave us the error messages you are getting and snippets of your script.