I am currently adding an aspx page to my web site (.net) where my clients can insert credit card details.
I would like to give access for that page from several pages only (lets call them a.aspx and b.aspx) and if someone tries to access this page from c.aspx he won’t be able to do so.
Is there a way to limit the redirect to a page for few pages only?
I’ve tried to check at the page event what is the source of the call, with the “sender” object, however I am not sure it the right way to go.
Hope the question is clear enough.
What you need to know to do this is the referer.
The referer is, briefly, the page that brought you to the page you are currently at.
I believe this should get the referrer for ASP.net
Then you can just check and see if the referer matches your desired origins. However, I’m not sure about the ease/prevalence of referer spoofing, or if it even exists.