from http import cookies # Creating a cookie cookie = cookies.SimpleCookie() cookie['state'] = 'California' cookie['state']['expires'] = 60*60*24*14 # Expires after 2 weeks # Modifying a cookie cookie['state'] = 'Texas' # Deleting a cookie cookie['state']['max-age'] = 0 # Printing cookies as string print(cookie.output())In the above example, the `SimpleCookie` class from the `http.cookies` package is used to create, modify and delete cookies. The output method of the `SimpleCookie` object is used to print the cookies as a string. Package Library: http.cookies