Rails 4: Cookie overflow when importing CSV
<p>I am attempting to analyze CSV before importing into my database but am encountering a <code>ActionDispatch::Cookies::CookieOverflow</code> error.  </p>

<p><strong>controller</strong></p>

<pre><code>def bulk_upload_weigh_ins
    @response = WeighIn.check_file(params[:file])
    redirect_to import_weigh_ins_path, notice: @response
end
</code></pre>

<p><strong>model</strong></p>

<pre><code>def self.check_file(file)
    status = {
        name_error: [],
        weigh_in_error: []
    }
    count = 0
    CSV.foreach(file.path, headers: @weigh_in_cols) do |row|
        hashed_row = row.to_hash
        user = User.find_by(scale_id: hashed_row["scale_id"])
        if user == nil
            status[:name_error] &lt;&lt; [hashed_row["name"], hashed_row["scale_id"]]
        elsif user.check_ins.with_no_weigh_ins.length != 1
            status[:weigh_in_error] &lt;&lt; [hashed_row["name"], hashed_row["scale_id"]]
        else
            count += 1
        end
        status[:number_of_success] = count
    end
    return status
end
</code></pre>

<p><strong>I've looked at <a href="https://stackoverflow.com/questions/9473808/cookie-overflow-in-rails-application">this</a> post but I'm not sure I should be using doing the same fix.  Is there a better way to set this up?</strong></p>