Cookie or Session for shopping card

Reply

Join Date: Apr 2008
Posts: 495
Reputation: veledrom is an unknown quantity at this point 
Solved Threads: 0
veledrom veledrom is offline Offline
Posting Pro in Training

Cookie or Session for shopping card

 
0
  #1
May 14th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 99
Reputation: csharplearner is an unknown quantity at this point 
Solved Threads: 3
csharplearner's Avatar
csharplearner csharplearner is offline Offline
Junior Poster in Training

Re: Cookie or Session for shopping card

 
0
  #2
May 14th, 2009
Originally Posted by veledrom View 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
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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1,402
Reputation: ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light 
Solved Threads: 224
Sponsor
ShawnCplus's Avatar
ShawnCplus ShawnCplus is offline Offline
Code Monkey

Re: Cookie or Session for shopping card

 
0
  #3
May 14th, 2009
Well if they block cookies they're blocking sessions as well since a user's SESSIONID is stored in a cookie.
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 99
Reputation: csharplearner is an unknown quantity at this point 
Solved Threads: 3
csharplearner's Avatar
csharplearner csharplearner is offline Offline
Junior Poster in Training

Re: Cookie or Session for shopping card

 
0
  #4
May 14th, 2009
Originally Posted by ShawnCplus View Post
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?
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,321
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 161
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: Cookie or Session for shopping card

 
0
  #5
May 14th, 2009
Originally Posted by csharplearner View Post
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
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC