# Sharing session data between apps

**URL:** <https://www.ruby-forum.com/t/sharing-session-data-between-apps/83803>\
**Category:** Rails\
**Created:** [January 29, 2007, 9:47pm UTC](https://www.ruby-forum.com/t/sharing-session-data-between-apps/83803 "2007-01-29T21:47:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimmy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ee59a6/32.png) [@jimmy](https://www.ruby-forum.com/u/jimmy)\
**Post date:** [January 29, 2007, 9:47pm UTC](https://www.ruby-forum.com/t/sharing-session-data-between-apps/83803/1 "2007-01-29T21:47:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jimmy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ee59a6/32.png) [@jimmy](https://www.ruby-forum.com/u/jimmy)\
**Post date:** [January 30, 2007, 2:24pm UTC](https://www.ruby-forum.com/t/sharing-session-data-between-apps/83803/2 "2007-01-30T14:24:36Z")

</div>

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  
Class.  
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.

---

<div class="post-metadata">

**Author:** ![jimmy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ee59a6/32.png) [@jimmy](https://www.ruby-forum.com/u/jimmy)\
**Post date:** [January 31, 2007, 8:35pm UTC](https://www.ruby-forum.com/t/sharing-session-data-between-apps/83803/3 "2007-01-31T20:35:00Z")

</div>

Check out this link:

> **[Dotrb.com is for sale | HugeDomains](https://www.hugedomains.com/domain_profile.cfm?d=dotrb.com)**
>
> Get this domain name before someone else does. Quick and painless shopping. Affordable payment options available.

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.
