[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Passing a PHP Session Variable to a ColdFusion Form

Posted on 2012-08-23
10
Medium Priority
?
833 Views
Last Modified: 2012-08-31
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.
0
Comment
Question by:jdines
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 14

Expert Comment

by:binaryevo
ID: 38325865
0
 
LVL 13

Accepted Solution

by:
srikanthmadishetti earned 1336 total points
ID: 38326669
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
 

Author Comment

by:jdines
ID: 38326877
THank you, I will give that a try. I'll let you know how it works out.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 29

Assisted Solution

by:Pravin Asar
Pravin Asar earned 664 total points
ID: 38328786
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
 
LVL 29

Expert Comment

by:Pravin Asar
ID: 38328805
0
 

Author Comment

by:jdines
ID: 38329332
Thank you very much
0
 
LVL 13

Expert Comment

by:srikanthmadishetti
ID: 38330915
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
 
LVL 13

Assisted Solution

by:srikanthmadishetti
srikanthmadishetti earned 1336 total points
ID: 38330987
cf_php uses the same stuff to move variables , Do remember that you are not passing the session it is just moving variables .
0
 

Author Closing Comment

by:jdines
ID: 38354078
Thank you for your assistance with this.  The information and direction provided has been very useful.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month18 days, 19 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question