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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting rid of cookies, resetting,...

Status
Not open for further replies.

SPrelewicz

Programmer
Jul 16, 2001
124
US
I posted this in the CGI forum, but am cross posting here:

I have a shopping cart type-ish of a thing. I want a user to be able to move around the site and add stuff that gets added to a cookie's value. When they go to the "cart", the CGI reads the cookie and slits/parses it up to fillin the "cart". No problem there.

Now, when a user hits submit, I redirect to a page, "thankyou", that has a SSI that runs a CGI that is supposed to destroy the cookie.

Here's that script:

#!/usr/local/bin/perl

#use CGI ':standard';
use CGI;

my $co=new CGI;

$cookie = $co->cookie
(
-name=>'data',
-value=>'',
-path=>'',
-expires=>'Wednesday, 8-Aug-02 23:59:59 GMT',

);

print $co->header(-cookie=>$cookie);


As you can see, I set the date to the past AND the value to null. But after I submit and this page is run, I go to add something else to the "cart" and everything else id still there, IE the cookie has NOT been destroyed. The baffling part is, to debug I printed out the cookie on the thankyou page, and it says the value is null. Ideas?

Thanks

Scott
 
Are you using the back button to get to the page that shows the content of the cart? If you are you are probably seing cached values and not the actual ones.
 
No, actually i walk through it again step by step. I thought of caching, and this may still be it. How would I not allow a cookie to be cached?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top