You want to make sure that all your hrefs and form actions have
"&#urltoken#" appended to them and are surrounded with cfoutput tags.  For
consistency, I'd suggest you also append that to your cflocations and set
addtoken="no".

doing this will make sure your client session trackers will be passed from
page to page and your variables will persist


Toby Tremayne
Code Poet and Zen Master of the Heavy Sleep
Show Ads Interactive
359 Plummer St
Port Melbourne
VIC 3207
P +61 3 9245 1247
F +61 3 9646 9814
ICQ UIN  13107913

-----Original Message-----
From: Rob Schuff [mailto:[EMAIL PROTECTED]]
Sent: Friday, 30 March 2001 4:12 PM
To: Fusebox
Subject: Newbie: client variable persistence problem


greetings folks,

I'm a bit new to both CF and Fusebox.  I have a simple FB app that works
well 'cept for the security stuff I'm adding in.  Seems like my client
variables do not persist properly.  here is an entry from my index.cfm file
for the FA ValidateUser with is called from dsp_login:

    <CFCASE value="ValidateUser">
  <CFIF trim(attributes.btnLogin) is "OK">
    <CFSET Client.UserID="#attributes.UserID#">
    <CFSET Client.Password="#attributes.Password#">
       <CFINCLUDE template="act_ValidateUser.cfm">
    <CFIF Client.IsValidated>
         <CFLOCATION URL="index.cfm?fuseaction=computers" ADDTOKEN="yes">
    <CFELSE>
      <!--- User was not validated --->
      <CFLOCATION URL="index.cfm?fuseaction=home" ADDTOKEN="yes">
    </CFIF>
  <CFELSE>
    <!--- User cancelled the login --->
    <CFLOCATION URL="index.cfm?fuseaction=home" ADDTOKEN="yes">
  </CFIF>

   </CFCASE>

here is my simple code for act_ValidateUser.cfm

<CFPARAM NAME="client.UserID" DEFAULT="">
<CFPARAM NAME="client.Password" DEFAULT="">

<CFIF trim(client.UserID) is "Rob">
  <CFSET client.IsValidated="True">
<CFELSE>
  <CFSET client.IsValidated="False">
</CFIF>

it works correctly for both cases of UserIsValidated, but only once.  For
instance if I login and am successfully validated I am bounced to the
dsp_computers.cfm page and the client variables have their expected values.
But as soon as I go to another page, the variable are not even defined.  SO
what have I done wrong?  It seems to be a scope/persistence issue.

thanks

rob

PS.  Here is app_globals.cfm:

<!--- app_globals.cfm --->

<CFSETTING ENABLECFOUTPUTONLY="no"
           SHOWDEBUGOUTPUT="yes">

<CFAPPLICATION NAME="GCRC Asset Manager"
               CLIENTMANAGEMENT="yes"
      CLIENTSTORAGE="cfClient"
               SESSIONMANAGEMENT="yes"
      SETCLIENTCOOKIES="no">

<CFPARAM NAME="application.title"
         DEFAULT="GCRC Asset Manager">

<CF_FORMURL2ATTRIBUTES>

<CFSET appPath="/fusebox/gcrcAssets">
<CFSET request.self=cgi.script_name>
<CFSET request.db.dsn="gcrcAssets">
<CFSET request.db.type="odbc">
<CFSET request.cfroot="#appPath#">
<CFSET request.webroot="#appPath#">
<CFSET request.fileroot="d:\InetPub\webroot\assets">

P.P.S.  I do include app_globals.cfm in index.cfm and I can see that data is
being generated and stored in the access table for client variable storage
that I have set up.

---------------------------------------------------------------------
Robert Schuff                                       Bull Run Software
[EMAIL PROTECTED]                                Portland, OR USA
---------------------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to