Python- bottle - cookies keep changing
问题 Below is my code for setting and reading cookies in bottle. if request.get_cookie('mycookiename'): cookie_id = request.get_cookie('mycookiename') else: cookie_id=str(uuid4()) response.set_cookie('mycookiename', cookie_id , max_age=31556952*2, domain='%s' % (cookie_domain)) When I go to firefox and firebug, I can see that the cookie is set. But, when I refresh the page, I get a new cookie. Every request is a new cookie id. So, how do I resolve? 回答1: This code works. You set a new value cookie