Single sign on - with other apps?

i have been working on a DOG of an application lately… in php…

after writing a few apps in rails, i am pretty sure i can nail this
thing in rail in just a few hours, instead of spending a few more days
putzing around with it in php…

my question is:

this thing uses a single sign in scheme that i designed (basically
passing a SESSIONID variable between the sites…) this worked really
well for the family of sites that were using it, but it means that to
have access to the user data, i would have to stay in the php realm.

if i can get around this, i will recode the app in rails and be done
with it…

is it possible to login at another domain using ldap (a site running on
php), and once i am logged in, become somehow logged in at the rails
site?

any help would rock…