Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    dev
    dev is offline
    New Coder
    Join Date
    Jan 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Give me a solution

    i have developed a shopping cart page.
    whenever i add a item to the cart i will insert the details into the database table .
    but i force the user to login to proceed with the shopping.

    The problem is whenever a user logins and continues shopping there will nt be a pblm because i have the Customerid maintained in the database table.

    But whenever defaultly i add an item before logging in how can i track the details if some other user tries to add in the same manner.

    please provide me a solution ASAP.

    thanks
    Dev

  • #2
    Regular Coder
    Join Date
    Jul 2002
    Location
    The sunny side of the Alps
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can store temporal information in a cookie. Or in a server session.

  • #3
    dev
    dev is offline
    New Coder
    Join Date
    Jan 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    can u please explain it more.
    i am gettng stuck up in doing wth that part.
    every time if its logd in or not i am adding it to a databse table then .
    if i login and add then its nt a pblm for me bcaz i hv the custid.
    bt if not .

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Location
    The sunny side of the Alps
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Generate a temporal CustomerID and save it in a cookie (persistent or session). If a user is not logged it, then assign the purchase to this temporal ID. Then, when the user logs in, just check whether there exists temporal ID and update the database records with the true ID of that specific customer.

  • #5
    dev
    dev is offline
    New Coder
    Join Date
    Jan 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for the solution.but one more doubt will ths work when multiple users browse the same page.

  • #6
    Regular Coder
    Join Date
    Jul 2002
    Location
    The sunny side of the Alps
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes. When a user comes to the site assign her a unique ID and store it in a cookie. As each of the users will have their own ID, it doesn't matter how many user browse your site at the same time.

  • #7
    dev
    dev is offline
    New Coder
    Join Date
    Jan 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank you .I am trying with the same.

  • #8
    dev
    dev is offline
    New Coder
    Join Date
    Jan 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    can i go with sessionid for uniqueId.

  • #9
    Regular Coder
    Join Date
    Jul 2002
    Location
    The sunny side of the Alps
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes. The only prerequisite for temporal ID is that it is unique and that you can read its value.

  • #10
    dev
    dev is offline
    New Coder
    Join Date
    Jan 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thank you for the solution and i have done with the work.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •