Solved

Share Session Variable Across Server Side Languages

Posted on 2009-05-04
6
466 Views
Last Modified: 2013-12-24
I got started out coding in Coldfusion. I know it is not open source like PHP and thus less used. I do however, really love the way it works and its simplicity. In any case, I am getting a lot of code PHP code from various vendors and other companies with whom I would like to integrate.

I have my users authenticate and then the Coldfusion establishes a session variable that tracks that they have logged in and their access level.

Once a person has authenticated, I would like to pass this session information along to the PHP scripts and hopefully use the same names so that both languages can grant/deny access accordingly.

I know that I could embed a form in the page and then have clicking on the link submit the hidden form to the PHP page that would then receive the authentication information. What would the downside to this be? Is there a better way?
0
Comment
Question by:firstheartland
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 17

Expert Comment

by:nplib
ID: 24297180
As far as I know it can't be done.   Sessions are a unique mechanism between a server and a client.
0
 
LVL 1

Author Comment

by:firstheartland
ID: 24297734
Thanks. I will leave this open.  Any suggestions?
0
 
LVL 17

Expert Comment

by:nplib
ID: 24297860
convert to all use the same code, or use cookies,
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 16

Accepted Solution

by:
duncancumming earned 400 total points
ID: 24298061
Use cfhttp to submit login credentials to a PHP page that does authentication?
0
 
LVL 1

Author Comment

by:firstheartland
ID: 24298611
Duncan,

I was trying to do what you suggested. I'm not an expert in CFHTTP.  I think this will work.  I attached the code below because I can't seem to get redirected to the receiving site.  

I mean for the flow to be

#1. Load .cfm page and submit credentials to log-in page on the server
#2. Server takes the variables and finds out that the authentication is valid
#3. User gets redirected to the intranet site.

Right now, I don't seem to get much of a result.  Any suggestions?
<cfhttp method="post"
	 redirect="yes" 
     throwonerror="yes" 
     useragent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; FDM)"
     url="phppage.php" >
	<cfhttpparam name="AID" value="username" type="formfield">
        <cfhttpparam name="apw" value="password" type="formfield">
        <cfhttpparam name="key" value="randomKey" type="formfield">
</cfhttp>

Open in new window

0
 
LVL 39

Assisted Solution

by:gdemaria
gdemaria earned 100 total points
ID: 24300755
Place your logged-in user's ID into a browser cookie.   PHP and Coldfusion can both read that.   In PHP use the information to fetch any other values that are needed.    To help keep it secure, you can add a hash.
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Echo values after a query in php 5 51
How to display get_the_terms within a function 3 38
phpmyadmin memory error 55 94
Link Stopped Working 7 32
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses how to implement server side field validation and display customized error messages to the client.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

739 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