Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble with my cookie values?

Status
Not open for further replies.

shu745

Programmer
May 14, 2001
79
0
0
US
Hey everyone, I have a dilema. I want to create an application (like a real-time shopping cart) which shows you a preview what items you have added into it.

Here is the asp page:
(it is the bottom-most cookie that appears only)

Here is the associated code:

The only problem is that when you refresh your browser the cookie value changes also. Is there a way for the cookie to stay the same?

If this were to be a hig-traffic site would it be better to just use session objects instead of cookies? What's the difference really?

Thanks for any help,
Shu
 
Can not see your code it gives an error from Brinkster.

Session OBjects eat up memory on the server so I would not recommened it for a huge traffic site. Cookies are good as long as the customer has not disabled them. Please fix the Code page so I can help you out sir.

Tom

 
I am taking a look at it right now.

Just thinking about this wouldn't it be easier to setup a Temp db to hold all the contents of a persons cart as they select stuff being that cookies can only hold 4k of data? Just a thought?
 
You are writing the the cookies on every refresh. Wouldn't you just do an If..Then for data in the cookies before your routine?
 
I am also doing a shopping cart for someone and I'm using a temp table for items in cart. If they check out then I write the temp table to an order table and delete the items in the temp table. If that helps!!!
 
[lol] nice logic! thread333-554571

____________________________________________________
[sub]$str = "sleep is good for you. sleep gives you the energy you need to function";
$Nstr = ereg_replace("sleep","coffee",$str); echo $Nstr;[/sub]
onpnt2.gif
[sub][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top