Forum Moderators: coopster
I was wondering if someone could point me to a good offline or online (I would prefer offline though) resource to get the gripps on dealing with cookies (both persistent and seesion based) to create an online application for one of my customer.
It will have almost the same capabilities than a ecommerce site, i.e. adding products and quatity to basket, retrieving basket info, retrieving past order info (for a short time i.e. a week or so), saving current basket for 24 hours and submitting order.
The diff with ecommerce site is that this would be for members and I would manage the product list so no need for fancy backend capabilities.
Thanks in advance.
Leo
we use cookies in our shop - the cookie holds the session id (32-digit random string). we then store all their choices (shopping basket) in a table in the database which i access using the COOKIE['sessionid'].
i think sessions are the best way of making sure as many people as possible can use the shop, 'cos if a cookie can't be set, then the session id is appended to each URL and passed in that way from page to page, so that the customer can be tracked through the shop. however because of our structure we can't use sessions - so a cookie is fine.
we also have a P3P privacy policy on the site, which helps with IE6 privacy issues
i'd still look into using tables to store the shopping basket - the cookie stores the session id which is used as the db table key
hth
I don't know of a cookie tutorial offhand, but you might try looking through some of the resources in this thread from the Forum Library
[webmasterworld.com...]
More to the point, however, you will also find some good resources to get you started with a database both in that thread and in the Forum Library in general.
I would have to agree that you don't want to depend on cookies for storing actualy shopping cart information. You want that in a DB, with the cookie just remembering that the user in question has an active shopping cart. If the user has cookies disabled or a cookie blocker or just clears the cookie cache, all information will disappear. If the cookie merely holds an id to the user and cart, that information is still there. If the user has signed up with a username and password, you can still retrieve the cart for users who have cookies disabled or who have lost the cookie.
Tom
- the number of people using it will be very limited (in the hundred(s))
- we can force them to have cookies enabled if they want to use this facility
I wanted to use cookies because I was thinking of allowing them to view and/or print past order for 7 days (easily done by setting a cookie expiry date) but they won't be allowed to modify them for now on.
I am just not sure how to do it.
Thanks for your help.
Leo