module Jpmobile::TransSidRedirecting

Public Instance Methods

redirect_to(options = {}, response_status = {}) click to toggle source
Calls superclass method
# File lib/jpmobile/trans_sid.rb, line 68
def redirect_to(options = {}, response_status = {})
  if apply_trans_sid? && jpmobile_session_id && options != :back && options !~ /^\w[\w+.-]*:.*/
    case options
    when String
      unless options.match?(/#{session_key}/)
        url = URI.parse(options)
        if url.query
          url.query += "&#{session_key}=#{jpmobile_session_id}"
        else
          url.query = "#{session_key}=#{jpmobile_session_id}"
        end
        options = url.to_s
      end
    when Hash
      unless options[session_key.to_sym]
        options[session_key.to_sym] = jpmobile_session_id
      end
    end
  end

  super(options, response_status)
end