Avatar of sharingsunshine
Flag for United States of America

asked on 

How Do I Delete A jQuery Cookie Upon Order Submission or Browser Close?

this is a follow on to the question at

Open in new window

I need the cookie to be deleted when they close the browser or submit the order.   This is the code I have to delete the cookie but it isn't going away for either reason.

jQuery('#cook').click(function(e) {
		document.cookie = "wantmembership=1; path=/";
document.cookie = 'wantmembership=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';
              jQuery(this).text("I Now Have A Membership!");

Open in new window

Web DevelopmentjQuery* cookie

Avatar of undefined
Last Comment
Julian Hansen

8/22/2022 - Mon