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

Posted on 2007-10-11
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 :)
Question by:galic1987
    LVL 5

    Assisted Solution

    Go through the link,

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

    Assisted Solution

    Better you will use session variables. In this site they use session variable.
    LVL 4

    Assisted Solution

    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!
    LVL 28

    Accepted Solution

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Suggested Solutions

    Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    761 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

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now