I'm building a shopping cart. I would like to keep items in the cart in the database. That means I need to tie the db information to the session. I can either store the session id in the database, or store a cart id in the session. Is one better than the other?
Most carts tend to keep information for a long time. Should I extend the session expiration length to a day? a week? a month? infinite? Or should I be setting a cookie with an extended expiration date, and using the standard for sessions?
Are there any other best practices I should know about?