kristianmandrup / cantango

CanCan extension with role oriented permission management, rules caching and much more
MIT License
404 stars 45 forks source link

ActionDispatch::Cookies::CookieOverflow - info stored in session? #15

Open dylancashman opened 12 years ago

dylancashman commented 12 years ago

First I wanted to say thank you for a great gem.

I'm having a CookieOverflow Error when using Cantango with a custom role system. I get the CookieOverflow when I try to log in as a user that has ~10 or so roles. It doesn't look like it's my own session, and I feel like I've seen Cantango save somethings in the session. Can you point me out to where Cantango might be accessing and manipulating the site cookie so I can see what I can do about it? I've tried to search through the wikis but I couldn't find it.

Thanks!

kristianmandrup commented 12 years ago

Yes, by default CanTango will try to cache the roles in the Session, which by default is stored in the cookie, which has very limited storage. One solution is to simply turn off caching. Another solution would be to configure Rails to use a Session store such as Memstore or similar which can handle larger amounts of data. CanTango also supports using Moneta as the cache (key-value store). Since around 0.9.4, CanTango employs a more advanced caching model which demands more storage on the Session. You could also go back to a CanTango version before, say 0.9 which employs a much simpler caching model. Note that we are in the process of totally refactoring/restructuring cantango for the 1.0 release, where it will be split up in various smaller subprojects. Good luck!