locked
Best approach to identify users RRS feed

  • Question

  • User206383436 posted

    I will be developing an ASP.NET MVC website where users will interact with a products catalog to place orders. As you already know, this type of web applications need to identify each user independently along with the items in a shopping cart and this can be done by using Session state but I wonder if this is a good choice and/or there is an additional and better way. What is the best approach to achieve this goal?

    Best regards,
    Jorge Maldonado

    Tuesday, November 20, 2018 8:12 PM

All replies

  • User-271186128 posted

    Hi Jorge 

    I will be developing an ASP.NET MVC website where users will interact with a products catalog to place orders. As you already know, this type of web applications need to identify each user independently along with the items in a shopping cart and this can be done by using Session state but I wonder if this is a good choice and/or there is an additional and better way. What is the best approach to achieve this goal?

    You could use session state to store the shopping cart, but please notice the session expired time and the session state modes.

    As far as I know, In the Inproc session state mode, the data might be loss. You could try to use the StateServer  or SQLServer mode.

    If you enable Web-garden mode by setting the webGarden attribute to true in the processModel element of the application's Web.config file, do not use InProc session state mode. If you do, data loss can occur if different requests for the same session are served by different worker processes.

    Otherwise, you could also directly using a database to store the product orders and shopping cart (configure relationship, and using foreign key).

    Best regards,
    Dillion

    Wednesday, November 21, 2018 6:45 AM