Re: CookieStore::CookieOverflow

John Barnette
2008-10-08T21:26:36Z

Hi,

On Wed, Oct 8, 2008 at 2:16 PM, Shandy Nantz
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
> I have recently upgraded to rails 2.1.0. and since I have, the parts of
> my app that deal with CookieStore (sessions) has failed to work any
> longer. In Crome and most other browsers my code simply fails, IE7 is a
> little more forgiving since I can get logged in and then I can only see
> certain pages. My session code is pretty simple, a session is created by
> saying:
>
> session[:user] = @user

You''re storing too much data. You should generally avoid storing
''real'' objects in the session. Instead, just store the ID:

  session[:user_id] = @user.id

...and revivify the actual user object when you need it.


~ j.