Python on the web: How to delete cookies in a CGI script

After you have a cookie that has been set, here is how you can delete it. The trick is to send an update to the cookie where you feed it an expiration date that is already in the past. For example: print “Set-Cookie: xml_edit_tool=Value of cookie; ‘expires=Wed, 28 Aug 2013 18:30:00 GMT’ \r\n” Note: When … Continue reading Python on the web: How to delete cookies in a CGI script

Python on the web: How to update cookies in a CGI script

Once you’ve retrieved a cookie via a function that returns the cookie as a dictionary of key value pairs, you can update the cookie in nearly the same way that you originally set the cookie. The only difference is that this time you can set different values. In this example, I am passing the retrieved … Continue reading Python on the web: How to update cookies in a CGI script