# Uploadify authentication problem

**URL:** <https://www.ruby-forum.com/t/uploadify-authentication-problem/184577>\
**Category:** Rails\
**Created:** [March 4, 2010, 8:11pm UTC](https://www.ruby-forum.com/t/uploadify-authentication-problem/184577 "2010-03-04T20:11:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kofuchs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f4b2a3/32.png) [@kofuchs](https://www.ruby-forum.com/u/kofuchs)\
**Post date:** [March 4, 2010, 8:11pm UTC](https://www.ruby-forum.com/t/uploadify-authentication-problem/184577/1 "2010-03-04T20:11:45Z")

</div>

I’m trying to use Uploadify in my project. Everything works in my  
machine, locally. The problem is when I use the same code in my  
production environment.  
When I try to upload a photo, it returns an error “HTTP 401”, but there  
are no errors in the log.

Rails(2.3.5)  
Uploadify(2.1.0)

## Here is my FlashSessionCookieMiddleware where the problem with the Flash authentication shoud be solved.

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/ req = Rack::Request.new(env) env[‘HTTP\_COOKIE’] = “#{@session\_key}=#{req.params[@session\_key]}”.freeze unless req.params[@session\_key].nil? end @app.call(env) if @app end end

Thanks.
