Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to make a shopping cart application. lator i use the paypal api for payments. i am confused which approach i have to use for making shipping cart. i studied that shopping cart making can be done in three ways.. using sessions, using cookie based apprach and using database approach.. can paypal support the three apporaches. which one is more relable. my question maybe sound stupid.. but sorry i want some info.
Posted

1 solution

the Paypal API doesn't care how store user data in your web application, so all three options are available to you.

Cookie based:
Your data is stored between sessions, that is when a user puts something in his shopping card and closes his browser it's still in his shopping card when you visits your site again (On the same PC logged in as the same user).
But I avoid using cookies for one reason, your user might have turned off cookies.

Session based:
It's easy to use, but once the user closes his browser it's gone.

Database based:
Like cookies, your data is stored between sessions, but it seems like to much hassle to me for a shopping card.

Session+Database:
If you have a login system, then you could, once a user logs in, retrieve the shopping card data from the database into session and once the session ends persist the shopping card data from the session to the database.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 16-Aug-11 22:55pm    
I like this answer, my 5.
--SA
Simon Bang Terkildsen 17-Aug-11 7:07am    
Thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900