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

session returns just a hash using default configs, makes it hard to debug #211

Open
fabioxgn opened this issue Jan 8, 2016 · 1 comment

Comments

@fabioxgn
Copy link

fabioxgn commented Jan 8, 2016

I've lost a couple of hours debugging today, because my sessions weren't working on a Rails app and I think that the culprit was this gem.

When you use this gem and try to use a session it returns just a hash, instead of the ActionDispatch::Request::Session which is Rails default.

I'm new to rails and for me it was "normal" for it to be a Hash, but I think to avoid wasting time debugging (as I did), it would be useful to make it easier for debugging. Some ideas that for me would be a better design than just "replace" the rails session with a Hash:

  • Raise an exception if you try to write to a session and it is not going to be stored
  • Log a warning if you write/read from a session when the session is disabled
  • Use another class as the session object, so it makes it easier to figure out that this gem overwrote the Rails session

After debugging a lot and trying a lot of things, I noticed this gem on the Gemfile, just commented it and everything worked again, and I was not even using it (I had replaced my ApplicationController to inherit from ActionController::Base).

As I said, I'm new to this, so I might me talking bullshit, if so, sorry, but if this is really caused by this gem, I'd really appreciate if it is easier to debug.

@pujiaxun
Copy link

Actually ,me too!!!
The same situation...

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

2 participants