ecommerce design

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
puraskar
Forum Newbie
Posts: 9
Joined: Thu Oct 12, 2006 12:42 pm

ecommerce design

Post by puraskar »

I'm using session methods to creat shoping cart and process it. Is it the write method to do so.I would be grateful if somebody can answer me.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Storing information in sessions is the most common way to maintain state in php if that is what you are asking.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

The real question is how long you want to persist the cart for. If you are ok having the data persistent for only the current session then using the session is probably preferable because PHP does the housekeeping tasks like removing abandoned carts. If you want longer persistence then you will need to go to user accounts and storing the cart in a database. I usually use sessions for simplicity. It is probably best to make your cart datasource independent.
(#10850)
Post Reply