sodascape Posted February 15, 2007 Share Posted February 15, 2007 I'm trying to put together a small download cart... downloading certain files after purchase. I am trying to stear away from having people sign up for a membership, I just want them to be able to come to the site, select what items they want to purchase and take them directly to the checkout page... but I want to have the "Add to Cart" option, so obviously, I want to create a cart. What's the best way? 1) Sessions w/cookies = obviously the easiest route, but not as dependable using cookies. 2) Sessions without cookies... havne't done it before, wondering if it is worth the effort. 3) Just add the shit to a database and remove it after they check out. THanks! Brad Link to comment https://forums.phpfreaks.com/topic/38581-whats-the-best-way/ Share on other sites More sharing options...
Guest Posted February 15, 2007 Share Posted February 15, 2007 Can't say if it's the best way, but consider the following: #3) Database You'll have to write up some code to do cleanup and maintanence, not to mention to communicate with the db. The database is suited for keeping information, but this means you'll have a lot of db traffic. I'm talking about if someone selects some things, add them to cart, and leaves without checking out... Need a cronjob or something. #2 or #1) Sessions only You will need to determine the right spot to activate sessions, otherwise your site will have a lot of "orphaned" sessions by random passersby or spiders, but thankfully they expire, db data won't until you tell it to. (I'm thinking of webserver load). But that's unavoidable without a login system. This means you'll have a lot of server traffic. So, db-load or server-load? Up to you from there. That is if I haven't forgotten anything . Sessions and cookies, like you said, would indeed be easier. Now, a look at the situation: is there *alot* of information to store? Or a little? If little, go with sessions, if a lot, go with db. Link to comment https://forums.phpfreaks.com/topic/38581-whats-the-best-way/#findComment-185167 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.