Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / May 2007



Tip: Looking for answers? Try searching our database.

Passing a Session variable to another Application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wally Kolcz - 20 Apr 2007 18:06 GMT
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.
BKBK - 20 Apr 2007 19:00 GMT
I don't think that would work. Sessions are tied to the application that spawn them.
Wally Kolcz - 20 Apr 2007 19:17 GMT
Thats what I thought. Thanks.
Adam Cameron - 20 Apr 2007 20:29 GMT
<!--- 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.

Signature

Adam

IT9 - 31 May 2007 20:09 GMT
Adam,

Once you have the session variables transferred to the new application, how do
you reference them?  Can you just use session.variablename or do you need to do
session.app.variablename?  I've done my cfdump and I see the varaibles but I
can't seem to get to the values.

Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.