Question
Cookies Dropped in IE Browsers
I was just wondering if anyone here have experienced the same
situation I'm in
right now. In a nutshell, I'm noticing on my ecommerce website the cookie holding
the shopping cart ID is being dropped after several clicks through the website
only with IE browsers. With the same code, it works just fine with
FireFox/Netscape browers.
Here's how my database driven shopping cart works on my site. In the
Application.cfm I have these lines of code:
<cfif NOT IsDefined("COOKIE.LastCartID")>
<cfset newCCID = #CreateUUID()#>
<cfcookie name="LastCartID" value="#newCCID#" expires="NEVER">
<cflock timeout="30" throwontimeout="No" name="#SESSION.SessionID#" type="EXCLUSIVE">
<cfset SESSION.CartID = COOKIE.LastCartID>
</cflock>
</cfif>
A first time visitor will have a new cart ID created and saved to a cookie
(COOKIE.LastCartID) and to a session variable (SESSION.CartID). Once the mini
shopping cart is reached, a query is made to the cart database to find contents
of the cart and will display the data. New customers will return 0 contents
obviously but returning customers who added items in a previous session will
display as such. Now, what I noticed is after adding an item to the cart and
making about 20 or so click throughs on the site, the cart returns 0 items and
with my debugging code on, a whole new cookie ID is created as well as other
session variables (CFID, CFTOKEN, etc.)
I'm just wondering if anyone else experienced this and what strategies should I
undertake to resolve this. This is an issue specific to IE browsers. Thanks.
Orlando
right now. In a nutshell, I'm noticing on my ecommerce website the cookie holding
the shopping cart ID is being dropped after several clicks through the website
only with IE browsers. With the same code, it works just fine with
FireFox/Netscape browers.
Here's how my database driven shopping cart works on my site. In the
Application.cfm I have these lines of code:
<cfif NOT IsDefined("COOKIE.LastCartID")>
<cfset newCCID = #CreateUUID()#>
<cfcookie name="LastCartID" value="#newCCID#" expires="NEVER">
<cflock timeout="30" throwontimeout="No" name="#SESSION.SessionID#" type="EXCLUSIVE">
<cfset SESSION.CartID = COOKIE.LastCartID>
</cflock>
</cfif>
A first time visitor will have a new cart ID created and saved to a cookie
(COOKIE.LastCartID) and to a session variable (SESSION.CartID). Once the mini
shopping cart is reached, a query is made to the cart database to find contents
of the cart and will display the data. New customers will return 0 contents
obviously but returning customers who added items in a previous session will
display as such. Now, what I noticed is after adding an item to the cart and
making about 20 or so click throughs on the site, the cart returns 0 items and
with my debugging code on, a whole new cookie ID is created as well as other
session variables (CFID, CFTOKEN, etc.)
I'm just wondering if anyone else experienced this and what strategies should I
undertake to resolve this. This is an issue specific to IE browsers. Thanks.
Orlando