-
-
Save KiranPanesar/b46210da3e82c61a79f74f51e20cf854 to your computer and use it in GitHub Desktop.
Skip the default Rails session (when building an API)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
before_action :skip_session | |
private | |
def skip_session | |
if request.format == :json | |
request.session_options[:skip] = true | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment