Hello,
So I am looking to create a simple shopping cart that is only able to be viewed before checkout. I was thinking of using a $_SESSION variable to do this like $_SESSION['shoppingCart] = array(); then adding each item to the shopping cart array. Now my question is this: if I were to do it this way would each persons session variable be unique to themselves (there is no login required for this)?
Thanks in advance!
PHP $_SESSION QuestionThinking of using session variables for a shopping cart
Page 1 of 1
4 Replies - 600 Views - Last Post: 22 March 2010 - 01:16 AM
Replies To: PHP $_SESSION Question
#2
Re: PHP $_SESSION Question
Posted 22 March 2010 - 01:10 AM
Only until they log out or close the browser. You would need to store it in a database if it needed to be permanently stored. I advise against using Cookies, if that was your alternative.
This post has been edited by Xuhybrid: 22 March 2010 - 01:10 AM
#3
Re: PHP $_SESSION Question
Posted 22 March 2010 - 01:12 AM
By logout you mean leave the site, close the browser, etc? Because there is no user login so I am just curious to know if everyone that is on the site will be using the same session variable or if it is unique to each persons own browser/browsing session. I do not need to store the information permanently but just for the time the user is at the site.
Thank you for the quick response.
Thank you for the quick response.
#4
Re: PHP $_SESSION Question
Posted 22 March 2010 - 01:14 AM
Yes, sry i edited my post to say or browser. The session would be the best option, it will be unique to each browser and computer.
#5
Re: PHP $_SESSION Question
Posted 22 March 2010 - 01:16 AM
Awesome. Thank you so much for your help and especially the quick responses!
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|