1 Reply Latest reply on Dec 8, 2008 8:19 AM by Newsgroup_User

    Sharing session variables with PHP

    opensource_
      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.
        • 1. Re: Sharing session variables with PHP
          Level 7
          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.