Hi,
I am having a problem with my shopping cart session. It times out when it is supposed to. But when the page is reloaded and the user reenters data, the system keeps giving me the following error:
An error occurred while evaluating the expression:
#session.cart[2]#
Error near line 24, column 41.
--------------------------------------------------------------------------------
The element at position 2 in dimension 2 of object "session.cart" cannot be found. That dimension of the object is empty. Please, modify the index expression.
The error occurred while processing an element with a general identifier of (#session.cart[2]#), occupying document position (24:25) to (24:44).
Date/Time: 08/05/02 12:54:08
Browser: Mozilla/4.0 (compatible; MSIE 5.01; Windows 98)
Remote Address: 127.0.0.1
HTTP Referrer: ------------------------------------------------------------
I think that it is just locking up the application because if I come back the next day, the session will work fine but throw out the same error when it times out.
I have the following code in my application.cfm:
------------------------------------------------------------
<!--- set up session management --->
<cfapplication name="shopping_cart"
sessionmanagement="yes"
sessiontimeout="#CreateTimeSpan(0,0,10,0)#"
applicationtimeout="#CreateTimeSpan(0,0,10,0)#">
<!--- check to see if the cart has been defined if it has not
set it up --->
<cfif NOT IsDefined("session.cart">
<!--- create a two dimensional array to store the items in --->
<cfset session.cart = ArrayNew(2)>
<!--- create a variable to hold the total cost of all items in cart
and set it to 0 --->
<cfset session.total_cost = 0>
</cfif>
------------------------------------------------------------
If anyone can tell me what's wrong with this thing or how to kill the session completely (if that is what I need to do) I would greatly appreciate the help.
Thanks!
I am having a problem with my shopping cart session. It times out when it is supposed to. But when the page is reloaded and the user reenters data, the system keeps giving me the following error:
An error occurred while evaluating the expression:
#session.cart[2]#
Error near line 24, column 41.
--------------------------------------------------------------------------------
The element at position 2 in dimension 2 of object "session.cart" cannot be found. That dimension of the object is empty. Please, modify the index expression.
The error occurred while processing an element with a general identifier of (#session.cart[2]#), occupying document position (24:25) to (24:44).
Date/Time: 08/05/02 12:54:08
Browser: Mozilla/4.0 (compatible; MSIE 5.01; Windows 98)
Remote Address: 127.0.0.1
HTTP Referrer: ------------------------------------------------------------
I think that it is just locking up the application because if I come back the next day, the session will work fine but throw out the same error when it times out.
I have the following code in my application.cfm:
------------------------------------------------------------
<!--- set up session management --->
<cfapplication name="shopping_cart"
sessionmanagement="yes"
sessiontimeout="#CreateTimeSpan(0,0,10,0)#"
applicationtimeout="#CreateTimeSpan(0,0,10,0)#">
<!--- check to see if the cart has been defined if it has not
set it up --->
<cfif NOT IsDefined("session.cart">
<!--- create a two dimensional array to store the items in --->
<cfset session.cart = ArrayNew(2)>
<!--- create a variable to hold the total cost of all items in cart
and set it to 0 --->
<cfset session.total_cost = 0>
</cfif>
------------------------------------------------------------
If anyone can tell me what's wrong with this thing or how to kill the session completely (if that is what I need to do) I would greatly appreciate the help.
Thanks!