Passing a PHP Session Variable to a ColdFusion Form

  I have a bit of a problem. We developed a new intranet system that needs to incorporate existing ColdFusion forms. I need the PHP session variables (LogonId, Company, Password, Role) to pass to the ColdFusion pages and I am not sure how to accomplish this.  Thanks for your assistance.
Who is Participating?
srikanthmadishettiConnect With a Mentor Commented:
write a coldfusion page which can accept these parameters in post method once you get those in your cfm page you can create your cf session.

your cf page should be some thing like this

<cfif structkeyexists(form,"logonid") and structkeyexists(form,"company")  and structkeyexists(form,"password")  and structkeyexists(form,"role") >
do validation with  username and password

<cfif authorized >
<!--- create your session varaibles --->
 <cfset session.logonid = form.logonid>
<cfset session.role= form.role>
Not authorized

In a php page  create a form with hidden fields for these elements and submit to this Cf page
jdinesAuthor Commented:
THank you, I will give that a try. I'll let you know how it works out.
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Pravin AsarConnect With a Mentor Principal Systems EngineerCommented:
The ColdFusion application server does not interfere with PHP's
application server memory and vice a versa. So no they do not share
sessions variables.

That being said, there are relatively simple methods to pass session
data back and forth.

Web services or plain http request [<cfhttp...>
and|or the PHP equivalent] would be the first things that occur to my mind.
Pravin AsarPrincipal Systems EngineerCommented:
jdinesAuthor Commented:
Thank you very much
No web server side languages share session between them and it is not recommended too , But we can manage them easily with some approach like I suggested in my earlier post .
srikanthmadishettiConnect With a Mentor Commented:
cf_php uses the same stuff to move variables , Do remember that you are not passing the session it is just moving variables .
jdinesAuthor Commented:
Thank you for your assistance with this.  The information and direction provided has been very useful.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.