Reputation: 143
I have been working on a client project to pass session data from a ColdFusion login page to PHP.
Does anyone know how to pass session variables from ColdFusion to PHP?
Upvotes: 0
Views: 1226
Reputation: 665
Use your database.
Upvotes: 0
Reputation: 773
I would to convert the session data into something PHP can understand. So, I would probably convert it to JSON and then store it in a database. Once you have crated the base PHP session query the db and process the JSON data into your PHP session.
You will only be able to do this with data that can be serialized such as strings, arrays, and structures. You could however create your own serializer for data not natively handled. If your ColdFusion session contains objects or binary data you won't be able to transfer those over.
Upvotes: 2
Reputation: 1090
CF and PHP cannot share in memory sessions variables. However, there are other alternatives such as using cookies.
I used that approach once because a client wanted to share sessions with PHP Forum software. I simply grabbed it using cookies, by finding what cookies were being set ie <cfdump var="#cookies#">
. Then converted those cookies into sessions variables. (If you need it the other way around, try doing it in reverse.)
Another possibility is sending data securely by using encrypted URL variables.
You can also refer to this question:
Using ColdFusion session variables in PHP
Upvotes: 1