Is there any way to accomplish this?

Like this, using php or python to post username, password and domain to the user portal.

Is re-build and keep the cookie possible?