Forum: Ruby on Rails sharing session data between apps

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
8f778136a1ac3f33ff7b6ff52869f9f5?d=identicon&s=25 Jimmy (Guest)
on 2007-01-29 21:47
is it possible to share session data between 2 separate rails apps So,
for example, You can login once and your session is recognized by the
other app as well?

I tried just sharing the session cookies but it seems like some session
data is also cached. I get this error in my development.log file:

"Session contains objects whose class definition isn't available.
Remember to require the classes for all objects kept in the session."

thanks in advance
D7c511ce5025d37b8c6bd9134e0f2bd9?d=identicon&s=25 Thorsten L (Guest)
on 2007-01-30 14:24
(Received via mailing list)
The Problem is that you store whole objects in your sessions, like
many user auth plugins do:

@user = User.find(:first, :condition => blablabla)
session[:user]  = @user

So, you would have to share that User Model .rb-file in all your apps,
because there's an object in the session that is  derieved from that
If you can change your app to only store actual data (e.g. only store
the user's ID (and group name or whatever) instead of the whole
object, that error should not come up again.
14f04abbe3ba9dbd53a7cd989885cf63?d=identicon&s=25 jason (Guest)
on 2007-01-31 20:35
(Received via mailing list)
Check out this link:
I had a project that had a similar requirement and i used simple rss
and mongrel to wrap things together.  Its not really a session between
two apps, but it might give an idea..   Good luck.
This topic is locked and can not be replied to.