"Best" is a subjective term because it all depends on your needs/wants. Storing information in Session will be slightly faster because there is not the overhead in opening a database connection, retrieving data, displaying it, etc.
Using session though, if a users session times out, they will lose their entire "Shopping Cart" and have to start over where as a database shopping cart can be persisted over multiple Sessions. Which you choose to do will depend, as I said, on your needs and wants.
"The one language all programmers understand is profanity."
|