Jonathan Rochkind wrote:

> Ah, but I guess now I have your sample code to _read_ a session. Do you 
> have any similar magic code to write it back out to the store? I guess I 
> can probably figure it out for myself now that I know the magic way to 
> fake a cgi session.


Ha, I've  made it work!  Now I just need to do it for rails 2.3 too, to 
have it both ways.

But here's the rails pre-2.3 version. Thanks Fred!

  Struct.new('FakeSession', :session_id)

      # Craziness to restore a session in Rails pre 2.2. Will most 
likely
      # need to be changed for Rails 2.2.

      fake_cgi_session = Struct::FakeSession.new('some session id')

      session_obj = 
ActionController::Base.session_store.new(fake_cgi_session)
      @session = session_obj.restore

      # Later, you've modified the hash and want to save it back to 
store?
      # just:

      session_obj.close




You want to save something, just modify that hash, and then call
-- 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to