Tricky You will not be able to connect your server to a third-party service, and then simply transfer the session cookie to your user and redirect it to a third-party application. This will not work because cookies are domain specific and domains cannot access cookies or set them by another domain.
Thus, your service will have to act as an interface for a third-party service, and therefore you will need to maintain a user session on your server. This user session monitors your user, will be registered in a third-party service and, if necessary, will access a third-party service. The session on your server will be the http client for this third-party service, so it will need to be able to correctly handle cookies, i.e. Simulate a browser.
In terms of setting up and servicing user sessions, several CPAN modules will be created to help you with this.
For more information on managing user sessions in Perl, see https://web.archive.org/web/1/http://articles.techrepublic%2ecom%2ecom/5100-10878_11-1044683.html
Edit: Some web services can manage user sessions by entering a session identifier in the URL when a client refuses cookies. If your third-party service does this, you can simply provide the login response URL as a redirect to the user. However, this will be violated if the sessions are tied to IP.
source share