2 Replies Latest reply on Dec 12, 2006 4:58 PM by Newsgroup_User

    Some Client Variables Not Being Set

    Level 7
      I have a site im developing that utilises a form and a database to verify a
      login. In my application page I am setting some client variables such as the
      datasource, username, password and they seem to be working fine as I can see
      them in my debugging output.

      My login page that resides in a directory up one level from my application
      page has the following code below in it that checks the users details.

      The authenitication seems to work fine and the user is redirected to the
      order.cfm page however for some reason the client variables CSemail,
      CSaccess, CSname, CStimeout are not being set. Im running MX 7. Any ideas
      why my client variables are not being set?


      <cfif stage EQ 'Process' and form.email NEQ '' and form.password NEQ ''>

      <cfquery name="query" datasource="#client.dsn#"
      username="#client.username#" password="#client.password#">
      Select * from customer_service
      where Email_address =<cfqueryparam value="#trim(form.Email)#"
      cfsqltype="cf_sql_varchar" maxlength="100">
      AND Password=<cfqueryparam value="#trim(form.Password)#"
      cfsqltype="cf_sql_varchar" maxlength="14">
      </cfquery>

      <cfif isdefined("query.recordcount") and query.recordcount NEQ 0>
      <cfset client.CSemail='#trim(query.email_address)#'>
      <cfset client.CSaccess='YES'>
      <cfset client.CSname='#trim(query.first_name)# #trim(query.last_name)#'>
      <cfset client.CStimeout= now()+ #CreateTimeSpan(0, 0, 20, 0)#>

      <cf_tags_location url="orders.cfm" addtoken="no">
      </cfif>

      </cfif>



      application.cfm
      <!--------------------------------------------->

      <CFAPPLICATION NAME="Brdayserve" SESSIONMANAGEMENT="YES"
      clientmanagement="yes"
      sessiontimeout="#CreateTimeSpan(0,0,30,0)#" SETCLIENTCOOKIES="NO">


      <!--- Set Default Values --->
      <cfset client.database="development">
      <cfset client.dsn="development">
      <cfset client.username="xxxxx">
      <cfset client.password="xxxxx">


        • 1. Re: Some Client Variables Not Being Set
          Level 7
          Further to my previous post. Ive done some further investigation.

          My client variables work if i comment out the redirect like below.

          <cfif stage EQ 'Process' and #email# NEQ '' and #password# NEQ ''>
          <cfquery name="cs" datasource="#client.dsn#" username="#client.username#"
          password="#client.password#">
          Select * from customer_service
          where Email_address =<cfqueryparam value="#trim(form.Email)#"
          cfsqltype="cf_sql_varchar" maxlength="100">
          AND Password=<cfqueryparam value="#trim(form.Password)#"
          cfsqltype="cf_sql_varchar" maxlength="14">
          </cfquery>
          </cfif>

          <cfif stage EQ "Process" and isdefined("cs.recordcount") and cs.recordcount
          NEQ 0>
          <cfset client.CSemail="#trim(cs.email_address)#">
          <cfset client.CSaccess="YES">
          <cfset client.CSname="#trim(cs.first_name)# #trim(cs.last_name)#">

          <!-----<cflocation url="CService/orders.cfm" addtoken="no">------>
          </cfif>

          But as soon as I make the cflocation tag active in the code my client
          variables do not exist in my orders.cfm page.

          Has anyone got any suggestions?




          "Sammy" <orders@seton.net.au> wrote in message
          news:ellc5h$e8o$1@forums.macromedia.com...
          >I have a site im developing that utilises a form and a database to verify a
          >login. In my application page I am setting some client variables such as
          >the datasource, username, password and they seem to be working fine as I
          >can see them in my debugging output.
          >
          > My login page that resides in a directory up one level from my application
          > page has the following code below in it that checks the users details.
          >
          > The authenitication seems to work fine and the user is redirected to the
          > order.cfm page however for some reason the client variables CSemail,
          > CSaccess, CSname, CStimeout are not being set. Im running MX 7. Any ideas
          > why my client variables are not being set?
          >
          >
          > <cfif stage EQ 'Process' and form.email NEQ '' and form.password NEQ ''>
          >
          > <cfquery name="query" datasource="#client.dsn#"
          > username="#client.username#" password="#client.password#">
          > Select * from customer_service
          > where Email_address =<cfqueryparam value="#trim(form.Email)#"
          > cfsqltype="cf_sql_varchar" maxlength="100">
          > AND Password=<cfqueryparam value="#trim(form.Password)#"
          > cfsqltype="cf_sql_varchar" maxlength="14">
          > </cfquery>
          >
          > <cfif isdefined("query.recordcount") and query.recordcount NEQ 0>
          > <cfset client.CSemail='#trim(query.email_address)#'>
          > <cfset client.CSaccess='YES'>
          > <cfset client.CSname='#trim(query.first_name)# #trim(query.last_name)#'>
          > <cfset client.CStimeout= now()+ #CreateTimeSpan(0, 0, 20, 0)#>
          >
          > <cf_tags_location url="orders.cfm" addtoken="no">
          > </cfif>
          >
          > </cfif>
          >
          >
          >
          > application.cfm
          > <!--------------------------------------------->
          >
          > <CFAPPLICATION NAME="Brdayserve" SESSIONMANAGEMENT="YES"
          > clientmanagement="yes"
          > sessiontimeout="#CreateTimeSpan(0,0,30,0)#" SETCLIENTCOOKIES="NO">
          >
          >
          > <!--- Set Default Values --->
          > <cfset client.database="development">
          > <cfset client.dsn="development">
          > <cfset client.username="xxxxx">
          > <cfset client.password="xxxxx">
          >
          >


          • 2. Re: Some Client Variables Not Being Set
            Level 7
            Ok, i got it. stupid.

            <cflocation url="CService/orders.cfm" addtoken="yes">

            didnt realise i have to pass the token


            "Sammy" <orders@seton.net.au> wrote in message
            news:elng2p$3qr$1@forums.macromedia.com...
            > Further to my previous post. Ive done some further investigation.
            >
            > My client variables work if i comment out the redirect like below.
            >
            > <cfif stage EQ 'Process' and #email# NEQ '' and #password# NEQ ''>
            > <cfquery name="cs" datasource="#client.dsn#"
            > username="#client.username#" password="#client.password#">
            > Select * from customer_service
            > where Email_address =<cfqueryparam value="#trim(form.Email)#"
            > cfsqltype="cf_sql_varchar" maxlength="100">
            > AND Password=<cfqueryparam value="#trim(form.Password)#"
            > cfsqltype="cf_sql_varchar" maxlength="14">
            > </cfquery>
            > </cfif>
            >
            > <cfif stage EQ "Process" and isdefined("cs.recordcount") and
            > cs.recordcount NEQ 0>
            > <cfset client.CSemail="#trim(cs.email_address)#">
            > <cfset client.CSaccess="YES">
            > <cfset client.CSname="#trim(cs.first_name)# #trim(cs.last_name)#">
            >
            > <!-----<cflocation url="CService/orders.cfm" addtoken="no">------>
            > </cfif>
            >
            > But as soon as I make the cflocation tag active in the code my client
            > variables do not exist in my orders.cfm page.
            >
            > Has anyone got any suggestions?
            >
            >
            >
            >
            > "Sammy" <orders@seton.net.au> wrote in message
            > news:ellc5h$e8o$1@forums.macromedia.com...
            >>I have a site im developing that utilises a form and a database to verify
            >>a login. In my application page I am setting some client variables such as
            >>the datasource, username, password and they seem to be working fine as I
            >>can see them in my debugging output.
            >>
            >> My login page that resides in a directory up one level from my
            >> application page has the following code below in it that checks the users
            >> details.
            >>
            >> The authenitication seems to work fine and the user is redirected to the
            >> order.cfm page however for some reason the client variables CSemail,
            >> CSaccess, CSname, CStimeout are not being set. Im running MX 7. Any ideas
            >> why my client variables are not being set?
            >>
            >>
            >> <cfif stage EQ 'Process' and form.email NEQ '' and form.password NEQ ''>
            >>
            >> <cfquery name="query" datasource="#client.dsn#"
            >> username="#client.username#" password="#client.password#">
            >> Select * from customer_service
            >> where Email_address =<cfqueryparam value="#trim(form.Email)#"
            >> cfsqltype="cf_sql_varchar" maxlength="100">
            >> AND Password=<cfqueryparam value="#trim(form.Password)#"
            >> cfsqltype="cf_sql_varchar" maxlength="14">
            >> </cfquery>
            >>
            >> <cfif isdefined("query.recordcount") and query.recordcount NEQ 0>
            >> <cfset client.CSemail='#trim(query.email_address)#'>
            >> <cfset client.CSaccess='YES'>
            >> <cfset client.CSname='#trim(query.first_name)#
            >> #trim(query.last_name)#'>
            >> <cfset client.CStimeout= now()+ #CreateTimeSpan(0, 0, 20, 0)#>
            >>
            >> <cf_tags_location url="orders.cfm" addtoken="no">
            >> </cfif>
            >>
            >> </cfif>
            >>
            >>
            >>
            >> application.cfm
            >> <!--------------------------------------------->
            >>
            >> <CFAPPLICATION NAME="Brdayserve" SESSIONMANAGEMENT="YES"
            >> clientmanagement="yes"
            >> sessiontimeout="#CreateTimeSpan(0,0,30,0)#" SETCLIENTCOOKIES="NO">
            >>
            >>
            >> <!--- Set Default Values --->
            >> <cfset client.database="development">
            >> <cfset client.dsn="development">
            >> <cfset client.username="xxxxx">
            >> <cfset client.password="xxxxx">
            >>
            >>
            >
            >