4

I was using document.referrer to know the previous page but right now in winter '18 document.referrer has only the host

Previous winter '18 document.referrer // "https://prefix.na50.visual.force.com/myPreviousPage"

Winter'18 document.referrer // "https://prefix.na50.visual.force.com/"

Somebody knows how I can obtain the previous page in a visualforce page?

  • Is the previous page also a Visualforce page? – IllusiveBrian Oct 13 '17 at 13:33
  • Yes it's a visualforce page – Carlos Iribar Oct 13 '17 at 14:16
8

Salesforce improves the browser security (release notes) and that is the reason because the referrer is only returning the host. However it's possible disabled this feature in the org in Setup -> Session Settings -> Referrer URL protection

enter image description here

  • Nice find! Thanks for sharing! Don't forget to come back in two days and accept this answer. :) – Adrian Larson Oct 13 '17 at 18:11
  • I love it when Salesforce add security features that break my managed packages. – Matt Lacey Oct 17 '17 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.