Access a variable on a Site tab from within a Page

The “other” page (or pages) needs to save its own URL like this:

session.setItem("page", wixLocation.url);

Then, when the page with the form is run, it retrieves the url like this:

let previousPageURL = session.getItem("page");