Sha256: 1bfc9777ffdda3fb9572e026c1fc2e9d05bb827546e17dfacbe6c6f03a1c88d8

Contents?: true

Size: 429 Bytes

Versions: 14

Compression:

Stored size: 429 Bytes

Contents

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)
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
dust-generators-0.2.8 rails_generators/dust_albums/templates/initializers/flash_session_cookie_middleware.rb
dust-generators-0.2.6 rails_generators/dust_albums/templates/initializers/flash_session_cookie_middleware.rb
dust-generators-0.2.5 rails_generators/dust_albums/templates/initializers/flash_session_cookie_middleware.rb
dust-generators-0.2.4 rails_generators/dust_albums/templates/initializers/flash_session_cookie_middleware.rb
dust-generators-0.2.3 rails_generators/dust_albums/templates/initializers/flash_session_cookie_middleware.rb
dust-generators-0.2.2 rails_generators/dust_albums/templates/initializers/flash_session_cookie_middleware.rb
dust-generators-0.2.1 rails_generators/dust_albums/templates/initializers/flash_session_cookie_middleware.rb
dust-generators-0.2.0 rails_generators/dust_albums/templates/initializers/flash_session_cookie_middleware.rb
dust-generators-0.1.9 rails_generators/dust_albums/templates/initializers/flash_session_cookie_middleware.rb
dust-generators-0.1.8 rails_generators/dust_albums/templates/initializers/flash_session_cookie_middleware.rb
dust-generators-0.1.7 rails_generators/dust_albums/templates/initializers/flash_session_cookie_middleware.rb
dust-generators-0.1.6 rails_generators/dust_albums/templates/initializers/flash_session_cookie_middleware.rb
dust-generators-0.1.5 rails_generators/dust_albums/templates/initializers/flash_session_cookie_middleware.rb
dust-generators-0.1.4 rails_generators/dust_albums/templates/initializers/flash_session_cookie_middleware.rb