[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

What is better to use for PHP shopping carts -  cookies or session?

Posted on 2007-10-11
4
Medium Priority
?
267 Views
Last Modified: 2008-01-09
What is better to use for PHP shopping carts -  cookies or session?

you will be rewarded with number of good arguments :)
0
Comment
Question by:galic1987
  • 2
4 Comments
 
LVL 5

Assisted Solution

by:siva_siva
siva_siva earned 600 total points
ID: 20055857
Go through the link,
http://www.phpwebcommerce.com/

In this they give all coding for an ecommerce site.
0
 
LVL 5

Assisted Solution

by:siva_siva
siva_siva earned 600 total points
ID: 20055862
Better you will use session variables. In this site they use session variable.
0
 
LVL 4

Assisted Solution

by:DeeEmm
DeeEmm earned 400 total points
ID: 20055866
Sessions are more secure as they are hosted server side but cookies are more persistent.

The real answer depends on what data you want to store and for how long!
0
 
LVL 28

Accepted Solution

by:
gamebits earned 1000 total points
ID: 20055873
Cookie are saved on the user's computer, they can live forever and can be tempered with.
Session are stored on the server and cannot be tempered, at least not as easily.

For a shoping cart I would go with session although a mix of both is probably the best way to go.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month20 days, 1 hour left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question