Webbrowser redirect not working on streamlit cloud

Basically. The user is coming to my streamlit app from an external site with some query params in the url. I want to redirect the user to the next page(within my app) once they are done with the steps(sign up) on the landing page. And I want those query params to be passed too. Below is how I tried to do it which was working fine on local but not on streamlit cloud.

button_clicked = st.form_submit_button("Submit", use_container_width=True)
if button_clicked:
# Does something here

if button_clicked:
    # Does something here
    target_url = # different page url within the same app but using query params so passing full url, please do suggest if there's a better way to do this.
    webbrowser.open(target_url, new=0) #tried  new =0,1,2, none of them worked
    # webbrowser.open_new_tab(target_url) # this didn't work either