On 20 Apr 2009, at 19:31, Jonathan Rochkind wrote:
> > Frederick Cheung wrote: >>> Unless the specs for how to write a session store have changed in >>> 2.3, >>> it may be my code doesn't need to be different for 2.3. But if it >>> does, >>> I can deal with that too. >>> >> They did - had to rewrite a lot of that bit of my session store for >> 2.3 >> > > Thanks Fred. It actually looks like this would be fairly > straightforward > in 2.3. This blog post provides some hints: > > http://devblog.michaelgalero.com/2009/02/03/guide-to-rails-metal/ > > But my app is not yet working with 2.3 in general, and I'd like it to > work with both. And in pre-2.3, it seems, from looking at the Rails > source, that it would be REALLY tricky to do this. > 2.2 is a bit easier actually - Struct.new('FakeSession', :session_id) fake_cgi_session = Struct::FakeSession.new('some session id') session = WhateverSessionStoreClass.new(fake_cgi_session) session.restore Fred > So now I'm thinking of another option. One would be storing this > information in my own database models, keyed by Rails SessionID. But > once I've done that, I've kind of duplicated the ActiveRecordStore. So > another option would be writing my code to assume that the session > store > is an ActiveRecordStore -- if you make this assumption, instead of > trying to write store-agnostic code, then accessing the info in > pre-2.3 > looks to be more do-able. And I could write code that works with > either > pre 2.3 or 2.3. > If you assume ActiveRecord store it's pretty easy. find the row with the right session id, data is right there. Fred > Not sure what I'm going to do really. I need something keyed on > sessionID that is accessible outside a Rails request, as well as > inside > a Rails request. > > If anyone else has ideas, feel free to share. > > Jonathan > -- > Posted via http://www.ruby-forum.com/. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---