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. ASP.NET
  4. session or cache

session or cache

Scheduled Pinned Locked Moved ASP.NET
databasesalesquestion
4 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.
  • S Offline
    S Offline
    strawberrysh
    wrote on last edited by
    #1

    for shoppigcart I use session or cache?whitch on is better?why? (a customer select the item and can go to shoppingcart page and edit the order and then when the customer click the save button ,orders save in database.)

    N A 2 Replies Last reply
    0
    • S strawberrysh

      for shoppigcart I use session or cache?whitch on is better?why? (a customer select the item and can go to shoppingcart page and edit the order and then when the customer click the save button ,orders save in database.)

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Session or cache ? It shows you have no idea about what it is. Please purchase a book and learn ASP.NET. Session : Specific to user Cache : Available to all users

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

      1 Reply Last reply
      0
      • S strawberrysh

        for shoppigcart I use session or cache?whitch on is better?why? (a customer select the item and can go to shoppingcart page and edit the order and then when the customer click the save button ,orders save in database.)

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        In this case you have to use session, because Session is based on user. where cache is common for all user. you can use Cache where data for all user same.

        cheers, Abhijit

        D 1 Reply Last reply
        0
        • A Abhijit Jana

          In this case you have to use session, because Session is based on user. where cache is common for all user. you can use Cache where data for all user same.

          cheers, Abhijit

          D Offline
          D Offline
          doWhileSomething
          wrote on last edited by
          #4

          A more reliable implementation would be to have a temporary orders table you can save selections to this table up until the "check out" procedure. A vistior comes, you check for a cookie (shopper=1234), if they have the cookie you can query the temp table for previous orders, if they don't have the cookie, tag them with one. Any selection is saved to the temp table using the shopper id from the cookie. Once at check out, their cart would have items from the temp table, push these items to the real store/basket table. Once the order has been processed - do whatever.. removing the entries from the temp table. Once a month, once a week or every 24 hours, purge the temporary table to relieve bloating. Something like that should work and it would be more reliable. Relying on session or cache is never a good idea - both can expire unexpectedly.

          My Personal Site

          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