Is it possible to do part of a web flow in Perl and then transfer the rest of the session to Firefox?
I need to retry(with Perl) logging in to a website which returns 500 every now and then on a successful login, transfer the authenticated session to Firefox, from where I can continue my normal browsing. Is this possible?
If this is possible, how do I do it? Can you point me to some resources on how can transfer the cookie/session, etc ?
views:
221answers:
2Tricky. You will not be able to have your server log in to the 3rd party service, and then just serve up the session cookie to your user, and redirect him to the 3rd party app. This will not work because cookies are domain specific, and domains cannot access cookies from or set by another domain.
So your service will need to act as an interface to the third party service, and as such you will need to maintain a user session on your server. This user session keeps track of your user, will log in to third party service, and will make requests to the 3rd party service when appropriate. The session on your server will be an http client for this 3rd party service, so it will need to be able to handle cookies correctly - ie mimic a browser.
In terms of setting up and maintaining user sessions, there will be a number of CPAN modules to help you with this.
For more info on managing user sessions in Perl, see http://articles.techrepublic.com.com/5100-10878_11-1044683.html
Edit: some web services can manage user sessions by injecting a session id into the URL when the client refuses cookies. If your 3rd party service will do this, you could maybe just serve up the login response URL as a redirect to your user. However, this will break if sessions are bound to an IP.