Determining Referer in PHP

后端 未结 5 1379
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-22 04:01

What is the most reliable and secure way to determine what page either sent, or called (via AJAX), the current page. I don\'t want to use the $_SERVER[\'HTTP_REFERER

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-22 04:32

    We have only single option left after reading all the fake referrer problems: i.e. The page we desire to track as referrer should be kept in session, and as ajax called then checking in session if it has referrer page value and doing the action other wise no action.

    While on the other hand as he request any different page then make the referrer session value to null.

    Remember that session variable is set on desire page request only.

提交回复
热议问题