• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Passing a Session variable to another Application

LEGEND ,
Apr 20, 2007 Apr 20, 2007

Copy link to clipboard

Copied

The law school portal, which people log into, creates a session variable of
the unique id which allows them to have the site custom to them. I have
developed a module with its own Application.cfm and would like to pass that
session variable to the new application. Can this be done without renaming
the new module the same application name as the main portal.


TOPICS
Advanced techniques

Views

385

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 20, 2007 Apr 20, 2007

Copy link to clipboard

Copied

I don't think that would work. Sessions are tied to the application that spawn them.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 20, 2007 Apr 20, 2007

Copy link to clipboard

Copied

Thats what I thought. Thanks.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 20, 2007 Apr 20, 2007

Copy link to clipboard

Copied

<!--- app1.cfm --->
<cfapplication name="app1" sessionmanagement="true">
<cfset session.app1 = "app1">

<!--- app2.cfm --->
<cfapplication name="app2" sessionmanagement="true">
<cfset session.app2 = "app2">

<!--- app3.cfm --->
<cfset variables.transfer = structNew()>

<cfapplication name="app1" sessionmanagement="true">
<cfset structAppend(variables.transfer, session)>

<cfapplication name="app2" sessionmanagement="true">
<cfset structAppend(variables.transfer, session)>

<cfapplication name="app3" sessionmanagement="true">

<cfset session.app3 = "app3">

<cfset session.transfer = variables.transfer>

<cfdump var="#session#">


It's not hard to transfer session variables from one app to another
(obviously provided they're on the same CF instance).

To do it between CF instances, it's not hard to do it with a web service or
a <cfhttp> call or something like that.

--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 31, 2007 May 31, 2007

Copy link to clipboard

Copied

LATEST
Once you have the session variables transferred to the new application, they can be referenced by using session.structure.variablename. In the code above the "structure" would be replaced with "transfer" and the variablename would be whathever the name of the session variable you are trying to access.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation