I have been building a document Library system. The Application is shared
between all the sites using it by Virtual Directories.
I use session variables in the login.cfm to set the User information (GUID,
Directory, IsAdmin) after login authentication.
<cfset SESSION.Auth = StructNew()>
<cfset SESSION.Auth.Email = QryCheckLogin.Email>
<cfset SESSION.Auth.UserGUID = QryCheckLogin.UserGUID>
<cfset SESSION.Auth.LibraryGUID = QryCheckLogin.DocLibOwnerGUID>
<cfset SESSION.Auth.IsLoggedIn = 'YES'>
<cfset SESSION.Auth.Admin = '#App_Admin#'>
I am not locking the above.
Everything seems to be working when multiple users are on the site (on the
same website or sharing). I also named the Application dynamically by
<cfset AppName = #ListGetAt(CGI.HTTP_Host,'2','.')#>
<cfapplication name="DocumentLibrary#AppName#"
sessionmanagement="Yes"
setclientcookies="Yes"
sessiontimeout="#CreateTimeSpan(0,0,30,0)#"
applicationtimeout="#CreateTimeSpan(0,0,30,0)#">
Then I just use cfparam to set variables.
<cfparam name="App_DataSource" default="TheDatabase">
<cfparam name="App_DataBaseUser" default="TheUserName"><!---
<cfparam name="App_DataBasePass" default="ThePassword">
<cfparam name="App_Admin" default="NO">
<cfparam name="APP_Path" default="#expandPath('../../../../')#">
<cfparam name="APP_LibraryOwnerURL" default="#CGI.HTTP_Host#">
Should I use Application Variables?
Should I be locking them?
Rick
_____
From: Jim Davis [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 7:36 AM
To: CF-Talk
I explain this pretty thoroughly in my guide to CF variables here:
http://www.depressedpress.com/DepressedPress/Content/ColdFusion/Guides/V
<http://www.depressedpress.com/DepressedPress/Content/ColdFusion/Guides/V>
ariables/Index.cfm
I'm sure other people have other (perhaps better) opinions but that
should give you the skinny at least.
Jim Davis
-----Original Message-----
From: Paul Wilson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 8:08 AM
To: CF-Talk
Subject: Application and Request scope
I've been reading a few threads that advise on storing various things
(that's a technical description btw) in the
application or request scope. Why is this a good idea and what things
should be stored there?
Thanks!
_____
[Todays
_____
[Todays
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]