If both pages use the same controller and extensions, you can actually pass the state of the page from the first to the second. You'd need to change the code from an apex:outputLink to a apex:commandLink to make this happen, though.
If you don't want to share the view state across pages (e.g. you need different controllers), you can also use localStorage or sessionStorage to store the variable in the browser's memory cache while you travel between pages. This will require cooperation on both pages, as the former will need to set the value (localStorage.setItem('somekey', 'value')
), then retrieve it on NewPage (localStorage.getItem('somekey')
). You can also use document.cookie for small values (less than about 4kb) for broader browser compatibility.
If you have no control over NewPage, then you're pretty much out of luck. You need a POST action for the variable to persist invisibly, which means the receiving page needs to be able to understand this POST request. Using apex:commandLink would be the easiest way to achieve your goal, especially if you can design both pages to use the same controller.