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

ActionDispatch::Session::ActiveRecordStore failed to save session #153

Open
camiloabrilth1999 opened this issue Jan 16, 2020 · 0 comments
Open

Comments

@camiloabrilth1999
Copy link

Hi, I'm doing my own implementation of the session class, logically using this gem to save the sessions in a database.

Although I am aware that the data attribute contains the reference to the user, I customized my session model to add a field called user_id, being referenced in the database.

The problem is with the association in rail models, placing the line belongs_to :user will cause the following error:

   (0.4ms) BEGIN
  ↳ /.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-5.2.4.1/lib/active_record/log_subscriber.rb:98
   (0.3ms) ROLLBACK
  ↳ /.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activerecord-5.2.4.1/lib/active_record/log_subscriber.rb:98
Warning! ActionDispatch::Session::ActiveRecordStore failed to save session. Content dropped.


ActionController::InvalidAuthenticityToken - ActionController::InvalidAuthenticityToken:
  appsignal (2.10.0) lib/appsignal/rack/rails_instrumentation.rb:19:in 'call

I would like to know if anyone knows how to fix it or if they have any correct implementation of the session model

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