Mhtml
01-12-2004, 02:27 PM
I'm making a CMS for a computer hardware retail website and I'm trying to implement a shopping cart..
This cart works like most carts you see on the web, you can browse the range of goods adding a quantity of an item as you wish and modifying this on the main shopping cart page before going to the checkout.
Now, instead of cookies I was going to use sessions to keep track of the shopping cart of the user while they shop. This is where my problem comes up, what if someone edited their session id which I carry along as a querystring and got someone else's session id? They could mess with that users shopping cart and this would pose a problem..
So, what I'm thinking of now is instead of using a session id I would make everyone signup and login to shop and just have a unique user id for the cart and that is pretty much secure but of course rather annoying ..
So now I'm looking for a balance of security and ease for this ...
So what I've come up with now, is sort of a balance... For users that have cookies enabled I'd use a session and store it in a cookie with their browser .. for those who don't have cookies enabled they would have to signup and login to shop..
Is there a better way than my last idea though?
[edit:] You would have to login everytime you submitted a change to your cart BTW seeing as cookies wouldn't be available ... (hence annoying)
This cart works like most carts you see on the web, you can browse the range of goods adding a quantity of an item as you wish and modifying this on the main shopping cart page before going to the checkout.
Now, instead of cookies I was going to use sessions to keep track of the shopping cart of the user while they shop. This is where my problem comes up, what if someone edited their session id which I carry along as a querystring and got someone else's session id? They could mess with that users shopping cart and this would pose a problem..
So, what I'm thinking of now is instead of using a session id I would make everyone signup and login to shop and just have a unique user id for the cart and that is pretty much secure but of course rather annoying ..
So now I'm looking for a balance of security and ease for this ...
So what I've come up with now, is sort of a balance... For users that have cookies enabled I'd use a session and store it in a cookie with their browser .. for those who don't have cookies enabled they would have to signup and login to shop..
Is there a better way than my last idea though?
[edit:] You would have to login everytime you submitted a change to your cart BTW seeing as cookies wouldn't be available ... (hence annoying)