I'm not sure if this is what you're looking for, but the Page.Request variable has a UrlReferrer property:
that contains the previous url of the previously visited page.
As an alternative, I personally use the session. on the checkout page I set a session variable to true, and check that variable in the confirmation. If it's true I proceed, if it's false (or does not exist because it wasn't set) then I redirect out.
I hope this was helpful!