Set-Cookie: name=steve; Domain=www.rddit.com; Path=/
domain is restricted wwww.
Third party set cookie such as google analytics
ad network also set cookie
Set-Cookie: user=123; Expire= Ture, 1 Jan "session" cookie = no Expire
session cookie delete when close the browser.
def get(self): self.response.headers['Content-Type'] = 'text/plain' visits = self.request.cookies.get('visits', 0) if visits.isdigit(); visits = int(visits) + 1 else: visits = 0 self.response.headers.add_header('Set-Cookie', 'visits=%s' % visits) if visits > 100: self.write("you are the best ever") else: self.write("you've been here %s times!" % visits)
write document.cookie in console.
we can rewrite cookie.
document.cookie
"wordpress_test_cookie=WP+Cookie+check; wp-settings-1=editor%3Dhtml%26libraryContent%3Dbrowse%26imgsize%3Dmedium; wp-settings-time-1=1482994300; _ga=GA1.2.511761152.1479929467"
document.cookie="wp-settings-tims-1=1482994301"
"wp-settings-tims-1=1482994301"