Why not share everything through a database? I'm currently designing a system where you can use Zope (main system), PHP and perl. Everything is then connected to MySQL. Instead of encrypting your cookies, just give them an MD5 or random value and store all the info you now have encrypted in the cookies server-side. In short let all session and user info be stored in and retrieved from the database.
/jeorgen