Session is using/detected another tab opened

I met the issue of routing to wrong page and hit the error message of “Session is using/detected another tab opened”, if UUID is not found. My desired solution is it should routing to self-defined session.js and prompt self-defined message, if UUID is not found.

I used window.sessionStorage to keep the value of UUID, where UUID as a parameter to set and get the session generated by backend.
Every UI pages (cshtml) will use the UUID as the parameter in javascript and check if UUID is matched with session generated from backend. The codes are shown as below.

<script>
checkSession(window.sessionStorage.getItem("UUID"));
</script>

The function checkSession will uses ajax to access to the API and get back response.
If the response is 0, it should prompt us for the button choices of “Continue(Go back Home page)” or “Cancel”. But somehow, instead of showing the self-defined prompt, it redirect back to home page and prompt “Session is using/detected another tab opened”. The redirect code are shown as below.

window.open(parentHomeUrl, '_top')

Is there any way that do prompt correctly before going back to home page, and stop prompt the error message “Session is using/detected another tab opened”?