I believe U_Session is related to the cookie. If you are having something else work as the login for threads, you need to create the cookie as well.
I remember seeing a thread around here somewhere that someone was doing some similar. If you look around you should be able to find it. I'm pretty sure it was fairly detailed.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.