Esempio n. 1
0
File: Base.py Progetto: arzh/CS253
	def set_cookie(self, name, data, save = False):
		dhash = HashStr.make_sstr(data)
		cookie = "%s=%s; Path=/;" % (name, dhash)
		if save:
			cookie = cookie+" Expires= Tue, 1 Jan 2025 00:00:00 GMT;"

		self.response.headers.add_header('Set-Cookie', cookie)
Esempio n. 2
0
File: Base.py Progetto: arzh/CS253
	def get_cookie(self, name):
		cookie = self.request.cookies.get(name)
		return cookie and HashStr.check_sstr(cookie)