Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

PHP Shopping Cart Storage Question

Featured Replies

<--- this is PHP / MySQL btw --->

 

A user in an e-commerce site adds an item or two into their shopping cart/basket and then navigates elsewhere in the site.

 

After going elsewhere they return to the cart to find the items still there.

 

What is the storage of this data tied to? The database or a session?

Personally, I only use cookies to keep somebody logged in to a website if they choose to. For everything else, I use sessions.

  • Author

Cheers for the feedback. I'll post back with anything fairly interesting I find for anyone else viewing this topic.

It depends on what you need really. Sessions are the obvious choice but if you wanted to keep the items in the cart so that if a user closes their browser and returns a day later with their items still in the cart, cookies would be better.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.