you’ll be storing all associated objects with the user. I did that in
a project, and had 2 and 3 megabytes session files !
I completely agree with what you’re saying, but my advice wasn’t to
store the User object in session, but on how to set the associations,
which is the question that he asked. I also assumed that the login
system he was using had already made that decision for him, and that
he wouldn’t want to change it.
Another huge problem beyond what you pointed out is that it’s quite
easy to imagine the session User object getting out of sync with the
So, yes, I agree 100%, don’t store the user object in the session.
– Tom M.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.