Quantcast
Channel: User antpaw - Stack Overflow
Viewing all articles
Browse latest Browse all 35

Answer by antpaw for Rails secure session and cookies are not working with a CDN

$
0
0

Turns out Safari does send a Location header even if the form is hosted on the same domain and some other browsers don't. The location header value (cdn url) will not match with the application url (ec2 url) and the request will be marked as invalid in rails. I had protect_from_forgery instead of protect_from_forgery with: :exception and it took me quite a while to see this because i didn't receive any noticeable errors. The solution for me was to disable this setting:

Rails.application.config.action_controller.forgery_protection_origin_check = false

The default state of this setting was flipped in Rails 5.


Viewing all articles
Browse latest Browse all 35

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>