问题
I've been searching for this information and haven't found anything.
I want to disable cookies only for a particular route. Is there a way to do that?
回答1:
Doesn't work in the routes file, but you can always use this in associated controllers:
before_action :skip_cookies
and as a private method:
def skip_cookies
request.session_options[:skip] = true
end
That should avoid including any cookies for the actions inside the controller
来源:https://stackoverflow.com/questions/53809314/how-to-disable-sending-cookies-for-a-certain-route-only