On 20 Apr 2009, at 17:04, Jonathan Rochkind wrote:

>
> So, given a sessionID, I have need to read and write the session  
> stored
> information 'manually', from _outside_ an actual Rails
> request/controller.
>
> Readers, I know your first response may be to tell me I don't really
> want to do that. Trust me though, I really do, it makes sense for me  
> in
> my case.
>
> I know this wouldn't work if you're using the new cookie session  
> storage
> mechanism. But if you're using a server-side session storage  
> mechanism,
> I'm thinking there must be some reasonable way to do this.  But I'm
> having trouble figuring it out.
>
> I've tried looking through the rails source code to see how Rails  
> reads
> and write session, but I'm having trouble finding the relevant code. I
> also figured, gee, since Rails allows pluggable session storage
> architecture, there must be an abstract description of what a session
> store must implement, and how to access it, and that might help me --
> but I couldn't find that either.
>
How it is stored is almost all up to the session store - they need to  
be able to fetch the data for a given session id and store some data  
for a session id.

The details have changed between rails 2.2 and 2.3, in 2.2 it was the  
old cgi interface, in 2.3 it's the new rack interface - you'll need to  
instantiate the appropriate subclass of ActionController::SessionStore

Fred
> Anyone have any ideas or tips?  I'd like a
> session-storage-implementation-agnostic (assuming it's a server-side
> method of storage) way to read and write the session hash from  
> outside a
> Rails controller.
>
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to