Hi,
I agree with Samuli. Forget about all craziness related to MYSAPSSO2. Get a cookie from 3rd party system. If you want to set a cookie for client then you can use same trick as service MYSSOCNTL is using. You can write your own HTTP handler which will accept two URL parameters: 3rd party cookie content plus URL for redirection. So you will send a user to URL <SAP_HOSTNAME>/redirector?cookie=<content>&url=<URL>. This service will set a cookie passed via URL parameter and redirect user to 3rd party app. The only complication is that you have to be careful about domains.If you SAP system and 3rd part system have same domain then just a cookie for this domain, not just for a hostname of SAP system. Also do not forget to encode URL parameters with base64 to avoid issues with binary data. As I said above service MYSSOCNTL is doing almost same thing so you can have a look at its HTTP handler CL_HTTP_EXT_MYSSOCNTL. Here you can see how to read URL parameters, how to set cookies and how to redirect client to different URL.
Cheers