addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwchatcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgoogleimageimagesinstagramlinklocation-pinmagnifying-glassmailminusmoremuplabelShape 3 + Rectangle 1outlookpersonplusprice-ribbonImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruseryahoo

Re: [ruby-81] Sessions & Rails 2.3.2...

From: user 9.
Sent on: Wednesday, August 26, 2009 4:08 PM
Having spent the best part of a week debugging the sudden failure of sessions recently, I may be able to help.? The first thing to figure out is if the session is saving state and not loading, or loading but not saving.? In my case the ActiveRecordStore was not serializing the session data, but was loading and saving the session object.? This meant that previously set session values still existed, but any changes did not persist across calls.? I was able to validate that the logins were successful, but suffered similar issues to you.

In the end I tracked the problem down to overriding the ActiveRecord::Base.create_or_update method.? For some reason it completely broke ActiveSessionStore serialization, even if the redefined method contained the exact same code as the original.? I never completely figured out WHY that broke, but if I moved my changes to create and update methods that create_or_update called, I no longer experienced that problem.

My conclusion is that that code experiences some brittleness, most probably related to the filters.? If your code (or any gems/plugins) mess with any ActiveRecord methods, that would be where I'd start looking.

The other thing to think about would be going to SQLstore instead, which would make the session store a lot quicker.

Hope that is at least a little helpful,
Brendon.

On Wed, Aug 26, 2009 at 9:30 AM, Jon Seidel <[address removed]> wrote:
Hi... I've got a problem upgrading from Rails 1.3.6 to 2.3.2 and friends.
?
I use the session to store a couple of small but critical pieces of information for my app; I use ActiveRecordStore for this.


Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy