Beyond that, cookies come in different types. Some are always the same and you can hardcode the cookie information into your script. Others, such as those found on message boards when you are logged in change based on what the site sends to you and you have to get that information and adjust your "fake" cookie to match and then send that to the site.Here
is a thread where FiberOPtics created a way to log into a phpBB forum using sockets. It shows how he handled the second cookie type I mentioned, where it isn't a "static" cookie. It may help you.