Search code examples
ruby-on-rails-4devise

Rails and Devise Gem: Avoiding store session for certain controller and action


for certain ajax calls I want to skip store session. I use devise gem, when and how I can specify actions to exclude for update session?

regards


Solution

  • In the controller add:

    after_action -> { request.session_options[:skip] = true }
    

    As per the comments here:

    :skip will not a set a cookie in the response nor update the session state