ok, hmm, lets see.  we have off the web root


/login
/foo
/goo


in /login we have the login code where the use logs in.  We use an LDAP for auth.  In this code we grab some basic user stuffs, name, id, etc and set session.user.globalauthorized = 1.  In this code we use
<cfaplication name="main" .......>


in /foo and /goo we have an application.cfm file.  In it we have, among other things
<cfapplication name="main"..... >
<cfparam name="session.user.globalauthorized" default="0" />
<cfif session.user.globalauthorized NEQ 1>
    <cflocation url=""> </cfif>


<cfapplication name="foo" .....
<cfparam name="session.user.authorized" default="0" />
<cfif session.user.authorized IS 0>
<cflocation url="" addtoken="No" />
</cfif>


in /foo and /goo we have a dir login with local application level login code and teh global check.  Note that the root /login is only for a level 1 auth, as in who are you, and that's it.  The local app login code determines if the user is allowed acces
/foo/login/application.cfm would have something like
<cfset appurl = '/foo/login' />
<cfapplication name="main" ....
<cfparam name="session.main.globalauthorized" default="0" />
<cfif session.main.globalauthorized NEQ 1>
<cflocation url="" addtoken="no" />
</cfif>
<!--- make local copy of session data to transfer to other local session scope --->
<cfset variables.foo = duplicate(session.main) />


<!--- local session data stuffs setup session here...note this session supercedes the above--->
<cfapplication name="foo"....
<cfset session.user = duplicate(variables.foo) />
<!--- end local session data stuff --->
<!--- now do local app access check in index file or whereever --->


in /login/application.cfm
<cfapplication name="main".....


and then in /login/index.cfm we do the login routine, auth, and set session.user.globalauthorized = 1 and then cflocate the user back to the url.appurl var passed to us.


There are some nitty gritty details left out obviously, but the main 'zeitgeist' is there.


HTH.


Doug

-----Original Message-----
From: Lee Flier [mailto:[EMAIL PROTECTED]
Sent: Friday, March 12, 2004 11:16 AM
To: CF-Talk
Subject: Re: Passing session variables between applications

[EMAIL PROTECTED] wrote:

> are these 'franchise' sites on the same server?

Yes.

> I just setup a system to 'share' sessions for this setup.  I created a
> central login code area using an application named main.  basically no
> matter what application the user hits, i use the cfapplication tag to
> hit the application named main first, dupe the data I want from it to
> the local scope, then use the cfapplication tag to start the
> 'franchised' application.  So, in my login code for each application I
> have two cfapplication tags, the first for the main app, the second
> for the local app.  This allows me to share basic session data across
> apps as well as implementing a single-sign-on environment.

Great, this sounds like exactly what I need to do, but I'm a little
fuzzy on the specifics.  How do you "hit" the main application from the
sub-apps?  And how is your directory structure set up to do this?  Some
example code would be much appreciated.

Thanks,
Lee
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to