Let's say we require an id on the URL form to be able to detect that the user has logged in. How do we Open the saved form considering the built in functionalities of the modal pages and the dialogs automatically redirects to the saved form? In this case we need to pass in the id as well on the URL for opening saved form. How do we do that?
Maestro already contains a method for determining if a user is logged in of if they are anonymous. You can call Form.isAuthenticatedUser() to determine that state.
If you need the key for any other reason, and it is not part of the SystemProfile area of the form XML, you could have it injected into the form using property prefill.mapping, or have the form fetch it with a dynamic data call.