p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 2.0 Professional (http://p2p.wrox.com/forumdisplay.php?f=215)
-   -   Problem with WroxShop (http://p2p.wrox.com/showthread.php?t=62756)

nrlahoti October 9th, 2007 02:26 PM

Problem with WroxShop
 
I am trying to run Wroxshop shopping cart application from chapter 13 of Beginning with ASP.NET 2.0 C#. When I execute and open the URL in two different browser instances than both of them shows item in view shopping cart and addition or deletion of items in one browser instance gets reflected in another instance too. How can i change it so that if i add an item in one browser instance it should not get added in the shopping cart of another browser instance.

Please suggest some idea.

Thanks.


Imar October 9th, 2007 04:25 PM

Hi there,

If I am not mistaken, the Shopping Cart is based on the Profile feature of ASP.NET 2.0. Profile by default relies on cookies. Cookies are shared between browser windows you open with Ctrl+N or Ctrl+T (in IE at least, that is).

So, you're looking at a lot of default behavior here. Without some extensive rewriting of the application, you won't be able to do this.

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004

nrlahoti October 9th, 2007 09:55 PM

Hello Imar,
         Thanks for your reply. Do you mean to say that this is not possible with Profile and i have to use something like CookieCollection or session. Can you please suggest me the best way of how to implement that without changing a lot in the code. Can i change some settings in web.config or global.asax to achieve that behaviour of temporary shopping cart.

Thanks,
Nilesh


Imar October 10th, 2007 01:13 AM

Quote:

quote:Do you mean to say that this is not possible with Profile and i have to use something like CookieCollection or session.
Correct. By default, Profile relies on cookies, and so cookies itself, and session state as well. Moving away from Profile to cookies or session state gives you the same problems.

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004


All times are GMT -4. The time now is 04:28 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.