简体   繁体   中英

Varnish + Rails causes invalid authenticity tokens in development

Here is my situation. I am testing out Varnish on my local box (I'm doing some stuff related to page caching that would be a big pain to push to staging every time). Everything works fine, except whenever I submit a form, I get an ActionController::InvalidAuthenticityToken exception.

Varnish is running on localhost at port 6081, and Thin is running on localhost at port 80. I get the exception when I try to use the site using port 6081.

Is there any way I can get around this?

Okay, so the reason this was failing was my VCL file was clearing out all cookies on every request. Obviously, this would cause some issues with the authenticity token.

Silly fix for a silly problem :/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM