Question: Rails ActiveJob: write values to cookies in a perfrom_later sidekiq job

Question

Rails ActiveJob: write values to cookies in a perfrom_later sidekiq job

Answers 0
Added at 2016-11-11 19:11
Tags
Question

So I have a job inside a controller method, which I want to write different values to cookies.

class AController < ApplicationController
  def create
    # other code
    RunJob.perform_in(1.minute, cookies)
    # other code
  end
end

class SetAccountCookiesJob
  include Sidekiq::Worker

  def perform(cookies)
    cookies[:a] = SetA.call
  end
end

However, when I run bundle exec sidekiq to trigger the job, cookies passed to the job is interpreted as a string. Is there anyway to set cookies in a job?

Thanks

Answers to

Rails ActiveJob: write values to cookies in a perfrom_later sidekiq job

Source Show
◀ Wstecz