こんな感じで書くといいっぽい
Doing this at ApplicationController:
class ApplicationController < ActionController::API before_action :skip_session ## Skip sessions and cookies for Rails API def skip_session request.session_options[:skip] = true end end
And adding this in application.rb:
config.middleware.use ActionDispatch::Session::CookieStore
As @betoharres says, it's ugly but works for now.
確かに上手くいったけど、なんでこれで対処できているのか分からんのであとで調べる