How can I automate and share sessions between Firefox and Perl?

Is it possible to make part of the web stream in Perl and then transfer the rest of the session to Firefox?
I need to try again (with Perl) to enter a website that returns 500 each time a successful login, transferring the authenticated session to Firefox, from where I can continue normal browsing. Is it possible? If possible, how can I do this? Can you tell me some resources on how to pass cookie / session, etc.?

+4
source share
2 answers

It seems to me that it makes sense to do everything from within Firefox ... and control it from the outside. MozRepl (FF extension) and MozRepl (Perl module) can help you get it.

+6
source

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.

+2
source

All Articles