Skip to main content
Participant
December 8, 2008
Question

Sharing session variables with PHP

  • December 8, 2008
  • 1 reply
  • 1092 views
Is there a way to share sessions between ColdFusion and PHP? I'm looking for a way to use CF and PHP together on the same project. I've seen a way to run PHP within a CF page by using <cf_php> <?php tags but I'm looking for a way to run PHP natively in a .php file and still be able to access/modify CF session variables.
This topic has been closed for replies.

1 reply

Inspiring
December 8, 2008
opensource_ wrote:
> Is there a way to share sessions between ColdFusion and PHP? I looking for a
> way to use CF and PHP together on the same project? I've seen a way to run PHP
> within a CF page by using <cf_php> <?php tags but I'm looking for a way to run
> PHP natively in .php file and still be able to access/modify CF session
> variables.
>

The ColdFusion application server does not interfere with PHP's
application server memory and vice a versa. So no they do not share
sessions.

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.

You'll have to take into count that while the PHP portion of the
application is running the ColdFusion session timeout is ticking down as
well as the reverse. If this is a concern, some type of 'heart-beat'
logic would need to be used to call code that keeps to corresponding
session in the other application server alive.