Carl V wrote:

>What is the best way of creating variable session scopes called from a global vars 
>page without CF chucking errors..
>
>global vars page
><cfscript>
> request.sessionVar = "mySite"; // This changes across the mini sites
> request.dbsitePrefix = "test";
></cfscript>
>
>Application.cfm Page - and yes sessionmanagement is on  
><cfif Not IsDefined("SESSION[request.sessionVar]")>
>
><cfscript>
>SESSION[request.sessionVar] = StructNew();
>SESSION[request.sessionVar].USERNAME = "";
>SESSION[request.sessionVar].OBJECTID = "";
>SESSION[request.sessionVar].USER_LOGGEDIN = "false";
>SESSION[request.sessionVar].Agree = "False";
></cfscript>
></cfif>
>  
>
Its probably worth copying your session variable to a local variable, so 
that you don't keep hitting the session and to make it easier to access 
your variables.

request.thisSession = duplicate(session[request.sessionVar]);

This way your login references will be 
request.thisSession.Username/ObjectID/user_LoggedIn

You will need to remember to copy the "thisSession" variable back into 
session[request.sessionVar] at the end of the request, just in case any 
changes were made.

Hope this helps

Regards

Stephen


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=36

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182792
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to