Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Your application has sessions disabled #99

Closed
robert-damoc opened this issue Apr 14, 2022 · 1 comment
Closed

Your application has sessions disabled #99

robert-damoc opened this issue Apr 14, 2022 · 1 comment

Comments

@robert-damoc
Copy link

Hi. I am trying to upgrade rails from 6.1 to 7.0.2, and I have an issue with this gem on the new version:

ActionView::Template::Error (Your application has sessions disabled. To write to the session you must first configure a session store):
    11:       graphql_endpoint_path: graphql_endpoint_path,
    12:       initial_query: GraphiQL::Rails.config.initial_query,
    13:       logo: GraphiQL::Rails.config.logo,
    14:       headers: GraphiQL::Rails.config.resolve_headers(self),
    15:       query_params: GraphiQL::Rails.config.query_params
    16:     } %>
    17:   </body>

actionpack (7.0.2.3) lib/action_dispatch/request/session.rb:253:in `load_for_write!'
actionpack (7.0.2.3) lib/action_dispatch/request/session.rb:151:in `[]='
actionpack (7.0.2.3) lib/action_controller/metal/request_forgery_protection.rb:449:in `real_csrf_token'
actionpack (7.0.2.3) lib/action_controller/metal/request_forgery_protection.rb:467:in `csrf_token_hmac'
actionpack (7.0.2.3) lib/action_controller/metal/request_forgery_protection.rb:461:in `global_csrf_token'
actionpack (7.0.2.3) lib/action_controller/metal/request_forgery_protection.rb:370:in `masked_authenticity_token'
actionpack (7.0.2.3) lib/action_controller/metal/request_forgery_protection.rb:357:in `form_authenticity_token'
actionpack (7.0.2.3) lib/action_controller/metal/request_forgery_protection.rb:107:in `form_authenticity_token'
graphiql-rails (1.8.0) lib/graphiql/rails/config.rb:17:in `block in <class:Config>'
graphiql-rails (1.8.0) lib/graphiql/rails/config.rb:38:in `block in resolve_headers'
graphiql-rails (1.8.0) lib/graphiql/rails/config.rb:37:in `each'
graphiql-rails (1.8.0) lib/graphiql/rails/config.rb:37:in `each_with_object'
graphiql-rails (1.8.0) lib/graphiql/rails/config.rb:37:in `resolve_headers'
graphiql-rails (1.8.0) app/views/graphiql/rails/editors/show.html.erb:14

Tried pretty much everything I was able to find online (not too many things out there tho). Did anyone see this issue before or any ideas on how to make it work?

Related versions:

ruby 2.7.4
rails 7.0.2.3
graphql 2.0.2
graphiql-rails 1.8.0
@robert-damoc
Copy link
Author

Found the issue. It seems that before, we had in application.rb

config.session_store :disabled

To make it work, had to add the following line in development.rb

config.session_store :cookie_store, key: "_sample_app_session", domain: :all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant