On 21 Jan 2008, at 09:52, Ivor Paul wrote:
> Hi all
>
> How would you go about sharing a session between two rails2
> applications? I am using restful_authentication.
>
> A point in the direction of some relevant blogs would also be a
> great help.
>
This largely depends on what backend you use. If you set the session
key (ie in the initializer block, stick
config.action_controller.session = { :session_key =>
''_some_key''} )
then both apps should use the same cookie to track the session. You''re
also need to be serving both apps from the same host (so that the
browser does actually send the same cookies to both apps, otherwise
you don''t have a hope in hell)
What happens next largely depends on what backend you are using to
store sessions:
- cookiestore: the cookie is the session, so if your apps can share
cookies you should be golden
- activerecordstore/other db backed session stores: both apps will
need access to a common database
- pstore: you''ll need to set the apps to write the session files to
some common directory both can access
- memcache/drbstore: I''ve never used these.
So, in summary it''s probably possible. You should also be aware that 2
simultaneous actions can result in the session being slightly clobbered.
Fred> Regards
> Ivor
>
>
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---