Passing a PHP Session Variable to a ColdFusion Form

Hello,
  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.
jdinesAsked:
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.company= form.company>
<cfset session.role= form.role>
<cfelse>
Not authorized
</cfif>
</cfif>


In a php page  create a form with hidden fields for these elements and submit to this Cf page
0
 
binaryevoCommented:
0
 
jdinesAuthor Commented:
THank you, I will give that a try. I'll let you know how it works out.
0
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.
0
 
Pravin AsarPrincipal Systems EngineerCommented:
0
 
jdinesAuthor Commented:
Thank you very much
0
 
srikanthmadishettiCommented:
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 .
0
 
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 .
0
 
jdinesAuthor Commented:
Thank you for your assistance with this.  The information and direction provided has been very useful.
0
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.