Rails request.referer does not work in Internet Explorer

I work on Spree e-commerce on rails and use CAS for single sign-on.
After logging in via cas, I use request.referer to redirect to the previous page, but it doesn’t work in Internet Explorer.
In Internet Explorer, redirecting me to the home page of my application.

+4
source share
2 answers

IE does not send a referrer header in certain situations. Microsoft has a support article that describes this.

When linking one document to another in Internet Explorer 4.0 and later, the Referer header will not be sent if the link is on an HTTPS page on a page other than HTTPS. The Referer header will also not be sent when the link is connected to a protocol other than HTTP (S), for example file: //, to another page.

+3
source

As Douglas said, request.referer does not work from 'https' to 'http'. What you can do is save the URL before going to https: // url. I think this should work.

+2
source

Source: https://habr.com/ru/post/1445052/


All Articles