marmite Posted April 24, 2007 Share Posted April 24, 2007 Is there a protocol for this? Or just post which one you would do ) (and please don't tell me to put it in a cookie cos I've got to finish it by tomo!) Link to comment https://forums.phpfreaks.com/topic/48461-quick-poll-cart-data-keep-in-_session-variable-or-stick-in-a-table/ Share on other sites More sharing options...
taith Posted April 24, 2007 Share Posted April 24, 2007 $_SESSION the way i set mine up... was like this... $_SESSION[cart][]=array(id=>'product id#',quanity=>'#',colours=>'red|white(for example)',special=>'text'); but thats just me... then i have my functions to get all my other importants... weight, # in stock,etc... Link to comment https://forums.phpfreaks.com/topic/48461-quick-poll-cart-data-keep-in-_session-variable-or-stick-in-a-table/#findComment-236972 Share on other sites More sharing options...
marmite Posted April 24, 2007 Author Share Posted April 24, 2007 So you keep all the info in the variable? You don't write it to a table anywhere? Link to comment https://forums.phpfreaks.com/topic/48461-quick-poll-cart-data-keep-in-_session-variable-or-stick-in-a-table/#findComment-236987 Share on other sites More sharing options...
monk.e.boy Posted April 24, 2007 Share Posted April 24, 2007 So you keep all the info in the variable? You don't write it to a table anywhere? Well, session data is written as a file to the server hard drive. monk.e.boy Link to comment https://forums.phpfreaks.com/topic/48461-quick-poll-cart-data-keep-in-_session-variable-or-stick-in-a-table/#findComment-236990 Share on other sites More sharing options...
taith Posted April 24, 2007 Share Posted April 24, 2007 well... all the product information comes from the database... and honestly... i REALLY wouldnt want to clean up a database after everybody for those of you out there who look at a page, add stuff to your cart, then close the window(you know who you are)... but i keep all the non static stuff active in the $_SESSION[cart], so you know exactly what their getting... product id -> so you know what they are getting... can access that product, so you have all the static stuff(price, weight, amount in stock, etc...) quantity -> so you know how many their getting(if set to 0, removes from cart) colours -> so you know what colour they want(depending on availability) specials -> if they want any thing special done with the order therefore... the only thing thats in there besides customary stuff... is `id`... which again, allows you to access the product, then apply their custom stuff :-) Link to comment https://forums.phpfreaks.com/topic/48461-quick-poll-cart-data-keep-in-_session-variable-or-stick-in-a-table/#findComment-237005 Share on other sites More sharing options...
otuatail Posted April 24, 2007 Share Posted April 24, 2007 Yes there are people out there who look at the Jaguar and Ferrari and don't continue the transaction. but if you have a field in the table completed Y/N you can periodicaly kill thiss off. Session A dog is for life. A session variable for 20 mins. Desmond. Link to comment https://forums.phpfreaks.com/topic/48461-quick-poll-cart-data-keep-in-_session-variable-or-stick-in-a-table/#findComment-237052 Share on other sites More sharing options...
taith Posted April 24, 2007 Share Posted April 24, 2007 you can set sessions to last far longer then 20 min... i've left mine for days, and returned and it was still active... sessions are great, because your storing it on the server... and is near unhackable(if done right)... Link to comment https://forums.phpfreaks.com/topic/48461-quick-poll-cart-data-keep-in-_session-variable-or-stick-in-a-table/#findComment-237102 Share on other sites More sharing options...
otuatail Posted April 25, 2007 Share Posted April 25, 2007 Great. Please tell us how you can set a session variable on the server that lasts for days. Any code would be helpfull. X Link to comment https://forums.phpfreaks.com/topic/48461-quick-poll-cart-data-keep-in-_session-variable-or-stick-in-a-table/#findComment-237637 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.