开发者

Uploadify with IE 8 resetting the session (sever side is Rails 3 with Devise)

I have a super simple user profile page. The user logs in, go the profile page and upload a profile photo. For the upload I use Uploadify with the usual session hack.

Everything works perfectly in FF5, Safari and Chrome but开发者_开发技巧 when I test on IE 8 I see the following behavior:

  • uploadify upload the photo correctly
  • but when I click on the "save" button to save the profile the server redirects me to the signin page.

A little investigation has shown me that after the call to Uploadify it seems that IE destroys the cookies with the session in it therefore the use is pretty much logged out.

Any help is really appreciated. Thanks, -Matteo


Solved the issue by adding: protect_from_forgery :except => :create to the assets_controller, this is the controller used to upload files.


For others who come here, check out:

Rails Carrier Wave with JQuery Uploader

It goes into a little more depth on how to set csrf-param and csrf-token so that carrier wave works with Rails.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜