The problem is that your requirement is impossible. At least, not unless you augment the HTTP protocol and create your own. Otherwise, it's a stateless protocol - there's not supposed to be such a thing as the "previous" request. You've got a current request, and that's it.
There are various ways you can try to violate the standards (using the dreaded 'Referer' header, setting a cookie, etc.), but there's no way simple way to guarantee it.