Abhinav Garg Abhinav Garg - 3 months ago 60
Javascript Question

How to manually set REFERER header in Javascript?

I want to set Referer header of my webpage. Currently it displays "xyz" and I want to set it to "abc".

Viewed referer using

javascript:alert(document.referer)

ABG ABG
Answer

You cannot set Referer header manually but you can use location.href to set the referer header to the link used in href but it will cause reloading of the page.