943,917 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 708
  • PHP RSS
May 14th, 2009
0

Cookie or Session for shopping card

Expand Post »
Hi,

I use PHP and have a question.

As cookies and sessions have their pros and cons, I don’t know which one is better for shopping card.

If I use cookie then user my block it. Therefore, my e-commerce web site won’t serve the purposes.
If I use session then the content stored in current session will not be remembered in next visit.


What do you prefer?

Thanks
Similar Threads
Reputation Points: 38
Solved Threads: 0
Master Poster
veledrom is offline Offline
724 posts
since Apr 2008
May 14th, 2009
0

Re: Cookie or Session for shopping card

Click to Expand / Collapse  Quote originally posted by veledrom ...
Hi,

I use PHP and have a question.

As cookies and sessions have their pros and cons, I don’t know which one is better for shopping card.

If I use cookie then user my block it. Therefore, my e-commerce web site won’t serve the purposes.
If I use session then the content stored in current session will not be remembered in next visit.


What do you prefer?

Thanks
I think you may have to use user details such as login values(username) or ip address(to save visitor selection of items) along with sessions values such as items in the cart and save it database to retrieve for visitors next visit.
Last edited by csharplearner; May 14th, 2009 at 9:02 am.
Reputation Points: 11
Solved Threads: 3
Junior Poster in Training
csharplearner is offline Offline
99 posts
since Nov 2008
May 14th, 2009
0

Re: Cookie or Session for shopping card

Well if they block cookies they're blocking sessions as well since a user's SESSIONID is stored in a cookie.
Sponsor
Reputation Points: 520
Solved Threads: 268
Code Monkey
ShawnCplus is offline Offline
1,564 posts
since Apr 2005
May 14th, 2009
0

Re: Cookie or Session for shopping card

Click to Expand / Collapse  Quote originally posted by ShawnCplus ...
Well if they block cookies they're blocking sessions as well since a user's SESSIONID is stored in a cookie.
Using Sessions one need not store it on user's computer,
if we store the users ip and items in the cart in the database by sessions and later retreive them from database when visitor visits back and use them wouldnt that work?
Reputation Points: 11
Solved Threads: 3
Junior Poster in Training
csharplearner is offline Offline
99 posts
since Nov 2008
May 14th, 2009
0

Re: Cookie or Session for shopping card

Using Sessions one need not store it on user's computer,
if we store the users ip and items in the cart in the database by sessions and later retreive them from database when visitor visits back and use them wouldnt that work?
Nope, different ip same user
same ip different user
ip addresses are not fixed they are at the discretion of the ISP
Reputation Points: 562
Solved Threads: 368
Posting Maven
almostbob is offline Offline
2,970 posts
since Jan 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Email format with php form
Next Thread in PHP Forum Timeline: Site root - Not understanding which variable to use





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC