Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 29th, 2006, 07:15 PM
Registered User
 
Join Date: Aug 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default WroxShoppingCart problem

I have implemented the WroxShoppingCart from the beginning ASP.NET book. It uses profiles to store cart data and is working fine. Since that was working, I also stored other info in the profile. This is an anonymous profile, but I obviously want each user to be discreet.

I am writing a ticket purchasing system, and this is what I found during testing:

- User A selects an event and specifies a quantity of tickets and presses enter
- User B does the same
- User A then refreshes the page, and he all of a sudden has the quantities that User B specified. It's as if the shopping cart is shared among users.

I am doing this testing on two different machines. I found that other profile info was also being shared, but I changed all of that info so that it uses session variables, which is probably best anyway. Here is the profile section of my web.config:

<anonymousIdentification enabled="true"/>
     <profile enabled="true">
        <properties>
         <add name="Cart" serializeAs="Binary" type="tep.Commerce.tepShoppingCart" allowAnonymous="true"/>
        </properties>
     </profile>


I'm trying to get ready to go live with this, but this behavior is totally perplexing. PLEASE, can someone shed some light on this?

Thanks,
Terry
 
Old August 30th, 2006, 01:12 PM
Registered User
 
Join Date: Aug 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Anybody have a idea on this?

 
Old August 30th, 2006, 01:35 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

I don't have the book, so I don't know how the code for the cart looks like.

However, besides a problem in the profile, this could be a problem with the cart. Are the articles stored in static (shared) variables, or is the cart itself stored in a static member somewhere?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old August 30th, 2006, 02:47 PM
Registered User
 
Join Date: Aug 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't think it's a problem with just the cart, which is implemented as a user control. I used to have other properties defined in the profile that the cart didn't even use, like firstname, lastname, etc., until I just decided to use session variables. Those also seemed to be shared across all sessions.

I guess I was thinking that since this is the Wrox forum, that someone would be familiar with the shopping cart I'm talking about. I suppose if nobody has tried to implement it in a production environment (meaning multi-user), then they wouldn't have run into this problem.

 
Old August 31st, 2006, 08:24 AM
jminatel's Avatar
Wrox Staff
Points: 18,059, Level: 58
Points: 18,059, Level: 58 Points: 18,059, Level: 58 Points: 18,059, Level: 58
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2003
Posts: 1,906
Thanks: 62
Thanked 139 Times in 101 Posts
Default

Terry:
I think your comment about the multi-user production environment may be on to something. As a Beginning book, with the example meant really as a teaching example, yes, it's very likely that most of the book's readers won't have jumped directly from learning their first few ASP.NET examples to a production environment. And, since the forum tends mostly to draw the readers who have had problems with the code and not the 1000s more who got it to work on their own, yes, we're probably short on people actively watching the forums who have done this example in a production setting.

Imar of course is one of the bright shining star exceptions. He's the author on a different book for us (ASP.NET 2.0 Instant Results) but he's also helpful on almost all of the ASP.NET forums for general discussions and other books. While he may not have actually implemented this, he's got the best troubleshooting skills I've ever seen.

Jim Minatel
Senior Acquisitions Editor
Wiley Technology Publishing
WROX Press
Blog: http://wroxblog.typepad.com/
Jim's Book of the week: No book this week - Donate to the Red Cross!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Another issue with WroxShoppingCart App--please rsearing BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 14 September 1st, 2006 01:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.