Hi All
Had a strange event happened to us on a commercial site today which I
can't reproduce unfortunately. A shipping page which has been working
fine all weekend suddenly started behaving as if some (not all) of
it's submitted data was being reset on form submission. This stopped
users from getting past the page. Restarting the web server fixed
everything but now I'm trying to determine how this could have
happened and don't see any obvious causes in the code.
I have one theory which I'm pursuing at the moment - I noticed on
examining the code that I'd made unnecessary use of the 'global'
command in a function which is called from this particular page. The
variable names in the 'ebw_is_c_session_shippable' coincide with
those in the shipping page (because I previously used calls to
library methods to capture session data into globals). There are 2
things that puzzle me, however:
1] How would the sequence of calls below cause the variables
'$P_ShipLocationNM' etc to be emptied ?
2] This code, although not ideal, has been working fine for a while.
What kind of circumstances could cause the variables - session
interaction to suddenly start working differently ?
Many thanks if anyone has any clues !
Best Regards
Peter
The relevant execution flow goes something like this (summarised):
NOTE: The problem (shipping variables losing their data) occurs when
'defined($bGOship02)' is true (i.e. on form submission). Despite
this, it's not the only time 'ebw_is_c_session_shippable' is
executed, as it forms one of the tests early in the case statement.
************ 1] SHIPPING PAGE CODE
*********************************************
<%
C_TEXT($P_ShipLocationNM;$P_ShipPostageNM;$P_ShipServiceType))
case of
:((ebw_is_c_session_shippable=0)&(defined($bGOship02)))
` Redirect to the secure page
else
` It's not yet shippable - show the same page again with
appropriate content
$P_ShipLocationNM:=get session("ShipA")
$P_ShipPostageNM:=get session("ShipB")
$P_ShipServiceType:=get session("ShipC")
< WHEN PHENOMENON OCCURRED, THESE THREE VARIABLES WOULD APPEAR TO
BE BLANK, EVEN THOUGH THEY HAD DATA PREVIOUSLY IN THE SESSION.
$bGOship02 IS DEFINED>
end case
%>
************ 2] CODE FOR 'ebw_is_c_session_shippable' FUNCTION
************
<%
C_TEXT($P_ShipLocationNM;$P_ShipPostageNM;$P_ShipServiceType)
global($P_ShipLocationNM)
global($P_ShipPostageNM)
global($P_ShipPayTypeID)
$P_ShipLocationNM:=get session("ShipA")
$P_ShipPostageNM:=get session("ShipB")
$P_ShipServiceType:=get session("ShipC")
case of
:($P_ShipLocationNM="")
$P_RTN:=1
:($P_ShipPostageNM="")
$P_RTN:=2
:($P_ShipServiceType="")
$P_RTN:=3
Else
$ P_RTN:=0
end case
%>
_______________________________________________
Active4D-dev mailing list
Active4D-dev@aparajitaworld.com
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/