Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Shopping Cart: use cookies or database?

Shopping Cart: use cookies or database?

Scheduled Pinned Locked Moved Web Development
databasequestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LukeV
    wrote on last edited by
    #1

    Hi, in my website logs, I see that a lot of people are going to my online store and don't seem to have cookies enabled. So I was wondering if it was better to use a database to keep track of a shopping cart or most websites rely on cookies? What's the standard? Cookies or database? Thanks!

    V P S 3 Replies Last reply
    0
    • L LukeV

      Hi, in my website logs, I see that a lot of people are going to my online store and don't seem to have cookies enabled. So I was wondering if it was better to use a database to keep track of a shopping cart or most websites rely on cookies? What's the standard? Cookies or database? Thanks!

      V Offline
      V Offline
      V 0
      wrote on last edited by
      #2

      I dn't know what others do, but I'd go for Database (probably because I detest cookies (accept if you can eat them :-D)), if you do use cookies you should check if the user accepts them... good luck. "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

      1 Reply Last reply
      0
      • L LukeV

        Hi, in my website logs, I see that a lot of people are going to my online store and don't seem to have cookies enabled. So I was wondering if it was better to use a database to keep track of a shopping cart or most websites rely on cookies? What's the standard? Cookies or database? Thanks!

        P Offline
        P Offline
        Paul Watson
        wrote on last edited by
        #3

        You only really want to store an ID in a cookie, not the whole basket and other details. Cookies are fickle too, users can clear them, they can expire, they only hold so much data etc. etc. regards, Paul Watson South Africa The Code Project

        L 1 Reply Last reply
        0
        • P Paul Watson

          You only really want to store an ID in a cookie, not the whole basket and other details. Cookies are fickle too, users can clear them, they can expire, they only hold so much data etc. etc. regards, Paul Watson South Africa The Code Project

          L Offline
          L Offline
          LukeV
          wrote on last edited by
          #4

          Yeah, I made the switch to a database yesterday. It was a lot less work than I thought it would be! :)

          1 Reply Last reply
          0
          • L LukeV

            Hi, in my website logs, I see that a lot of people are going to my online store and don't seem to have cookies enabled. So I was wondering if it was better to use a database to keep track of a shopping cart or most websites rely on cookies? What's the standard? Cookies or database? Thanks!

            S Offline
            S Offline
            ScottSingleton
            wrote on last edited by
            #5

            if the overhead of running your shopping cart through the database server is too high, and you don't mind expiring variables the in-process session state server works really well for this. Just add your basket class as a session variable.


            'Cause I'm living on things that excite me, be it pastries or lobsters or love...
            I'm just trying to get by, being quiet and shy, in a world full of push and shove...
            Jimmy Buffett - The Wino and I know

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups