Open mks0101 opened 15 years ago
Hi, make sure that session data in additional post_params is set correctly!
I had to change this to the following:
post_params: {
'<%= ActionController::Base.session_options[:key] %>': '<%= cookies[ActionController::Base.session_options[:key]] %>',
'authenticity_token': '<%= form_authenticity_token %>'
},
I'm using Rails 2.3.5 and Passenger 2.2.7 – it works great with those settings above.
Hi. anveo! I used your github swfupload_demo project in my project. but happened ActionController::InvalidAuthenticityToken.
So. why?
Now i spent to find ActionController::InvalidAuthenticityToken. help me.
my rails version 2.3.4 and using passenger-2.2.5.
my source below is...
require 'rack/utils'
class FlashSessionCookieMiddleware def initialize(app, session_key = '_session_id') @app = app @session_key = session_key end
def call(env) if env['HTTP_USER_AGENT'] =~ /^(Adobe|Shockwave) Flash/ params = ::Rack::Request.new(env).params env['HTTP_COOKIE'] = [ @session_key, params[@session_key] ].join('=').freeze unless params[@session_key].nil? end @app.call(env) end
end
require 'mime/types' class Fattachment < ActiveRecord::Base belongs_to :user has_attached_file :attachment, :url => "/fattachment/forums/:id/:style/:basename.:extension", :path => ":rails_root/public/fattachment/forums/:id/:style/:basename.:extension"
end
ActionController::Dispatcher.middleware.insert_before(ActionController::Base.session_store, FlashSessionCookieMiddleware, ActionController::Base.session_options[:key])
<% session_key_name = ActionController::Base.session_options[:key] %>