Been spending a few hours trying to debug this - any help will be appreciated. Here's
the problem:
Page 1 sets a session variable SESSION.CustomerID
Page 2 does the following (in order):
(1) retrieves SESSION.CustomerID;
(2) saves its value in the variable PrevCustomerID;
(3) deletes SESSION.CustomerID
(4) displays PrevCustomerID
But it appears as if the deletion is always carried out first, even though it is step
3 in the code, so I end up with the default value for SESSION.CustomerID passing
through to PrevCustomerID.
The strangest part is that this problem only happens when using IE. When using
Mozilla, it behaves as expected (PrevCustomerID shows the value set in Page 1). Can't
figure why this server side process is affected by the client.
To help re-creation of the problem, I have created the bare bones of Page 1 and Page 2
below. Browse to page1.cfm and enter a number for CustomerID - this submits back to
itself and sets the session variable.
In the same browser window, browse to page2.cfm.
If using IE, it's gone to 0 (default value)
But if you use Mozilla, it shows the value you entered in page 1 (as you'd expect)
******************* page1.cfm *******************
<CFPARAM NAME="FORM.CustomerID" DEFAULT=0>
<CFSET CustomerID = FORM.CustomerID>
<CFPARAM NAME="FORM.Submitted" DEFAULT="">
<CFSET Submitted = FORM.Submitted>
<!--- Set session variable if CustomerID submitted --->
<CFIF Submitted IS "SUBMIT">
<CFSET SESSION.CustomerID = CustomerID>
</CFIF>
<HTML>
<HEAD><TITLE>Page 1</TITLE></HEAD>
<BODY>
<FORM METHOD=POST ACTION="page1.cfm">
<CFOUTPUT>
Existing Customer ID: #CustomerID#<BR>
</CFOUTPUT>
Enter new Customer ID (any number):<BR>
<INPUT TYPE=TEXT NAME="CustomerID" SIZE=8>
<INPUT TYPE=SUBMIT NAME="Submitted" VALUE="SUBMIT">
</FORM>
</BODY>
</HTML>
******************* page2.cfm *******************
<CFPARAM NAME="SESSION.CustomerID" DEFAULT=0>
<CFSET CustomerID = SESSION.CustomerID>
<!--- Save CustomerID to another variable --->
<CFSET PrevCustomerID = CustomerID>
<!--- Destroy the SESSION variable --->
<CFSET StructDelete(SESSION, "CustomerID")>
<!--- Now display the saved value --->
<HTML>
<HEAD><TITLE>Page 2</TITLE></HEAD>
<BODY>
<CFOUTPUT>
Saved Customer ID: #PrevCustomerID#
</CFOUTPUT>
</BODY>
</HTML>
--
Regards: Ayudh
+----------------------------------------------------------------+
| SOAP is the glue! Hook up your server directly to your bank. |
| Connect to VeriPay xServ, the Australian Payments Web Service. |
| Reliable, Secure, FAST: http://www.xilo.com/xserv |
+----------------------------------------------------------------+
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/