Are you remembering to pass on the URLToken (CFID/CFToken) when re-directing
or CFLOCATIONing? If not CF will lose track of the session you want to keep.
eg:

-----Original Message-----
From: mayo [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 1 October 2003 7:54 AM
To: CF-Talk
Subject: session variables and shopping cart


  I'm having an odd problem with my session variables.

  I'm storing a product id as a session variable <cfset session.item=#item#>
  and am using a _javascript_ to allow the users to select the qty of items.
  Most times everything goes well: session.item and session.qty are passed
as
  expected. Other times not. I'll two session.items.

  This is not good :-) It breaks the db call. I could get around this by
  creating session.itemTitle, session.itemPrice, etc... I would rather
figure
  out why it breaks.

  In case it matters the _javascript_ is below:

  <script langauge="_javascript_">

          function subTotal() // calculates subTotal for user : QTY x PRICE
=
  SUBTOTAL
                  {
                  document.forms[0].priceRetailSubTotal.value=
                          (
                          document.forms[0].itemQty.value*
                          document.forms[0].priceRetail.value
                          );

  document.forms[0].itemQty2.value=document.forms[0].itemQty.value;
                  }

          function cs() // if QTY is 1 go to previous page else send to
cart2
  to process session variables (below)
                  {
                          var i=document.forms[0].itemQty2.value;
                          if (i==1)
                                  {

  location.href="">                                   }
                          else
                                  {


<cfoutput>location.href="">   r='+i);</cfoutput>
                                  }
                  }
  </script>

  // cart2.cfm

  <cfif number GT "0">

          <cfset session.item=#item#>
          <cfset session.itemQty=#number#>
          <cfoutput><cflocation url="">
  </cfif>


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to