# Sharing Sessions between Ruby on Rails and PHP

**URL:** <https://www.ruby-forum.com/t/sharing-sessions-between-ruby-on-rails-and-php/128445>\
**Category:** Rails\
**Created:** [February 7, 2008, 7:25pm UTC](https://www.ruby-forum.com/t/sharing-sessions-between-ruby-on-rails-and-php/128445 "2008-02-07T19:25:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adil\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b487fb/32.png) [@Adil\_M](https://www.ruby-forum.com/u/Adil_M)\
**Post date:** [February 7, 2008, 7:25pm UTC](https://www.ruby-forum.com/t/sharing-sessions-between-ruby-on-rails-and-php/128445/1 "2008-02-07T19:25:11Z")

</div>

Hi there,

I have a RoR app but for one of the funcationality (photo uploads) I  
am using PHP. I need to know how I can share/access session  
information from RoR in PHP since the PHP also updates the database  
and the entry information is contained in the RoR sessions.

Please advice.

Thanks in advance.

Adil

---

<div class="post-metadata">

**Author:** ![Adil\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b487fb/32.png) [@Adil\_M](https://www.ruby-forum.com/u/Adil_M)\
**Post date:** [February 8, 2008, 9:35am UTC](https://www.ruby-forum.com/t/sharing-sessions-between-ruby-on-rails-and-php/128445/2 "2008-02-08T09:35:12Z")

</div>

On 7 Feb 2008, at 18:23, Adil M wrote:

> Hi there,
> 
> I have a RoR app but for one of the funcationality (photo uploads) I  
> am using PHP. I need to know how I can share/access session  
> information from RoR in PHP since the PHP also updates the database  
> and the entry information is contained in the RoR sessions.

What session store are you using? In all cases i think you’ll need to  
be able to unmarshal ruby objects from php. There are specs out there  
for the Marshal format.

Fred

---

<div class="post-metadata">

**Author:** ![Adil\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b487fb/32.png) [@Adil\_M](https://www.ruby-forum.com/u/Adil_M)\
**Post date:** [February 8, 2008, 3:20pm UTC](https://www.ruby-forum.com/t/sharing-sessions-between-ruby-on-rails-and-php/128445/3 "2008-02-08T15:20:21Z")

</div>

Are you set on using PHP? I like PHP but it would be simpler to stay  
within rails.

Check out the rails plugin attachment\_fu, I used this for photo  
uploads and it was really nice.

[http://clarkware.com/cgi/blosxom/2007/02/24](http://clarkware.com/cgi/blosxom/2007/02/24)

On Feb 7, 9:25 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![Adil\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b487fb/32.png) [@Adil\_M](https://www.ruby-forum.com/u/Adil_M)\
**Post date:** [February 15, 2008, 9:47pm UTC](https://www.ruby-forum.com/t/sharing-sessions-between-ruby-on-rails-and-php/128445/4 "2008-02-15T21:47:55Z")

</div>

On Feb 8, 2008, at 7:23 AM, Adil M wrote:

> Thanks in advance.
> 
> Adil
> 
> >

i have just edited added a note here to show how i achieved this using  
memcached

see [http://wiki.rubyonrails.org/rails/pages/PhpSession](http://wiki.rubyonrails.org/rails/pages/PhpSession)
