初学者求教 关于 cookie

1 view
Skip to first unread message

Allen

unread,
Oct 3, 2009, 3:20:41 AM10/3/09
to Google App Engine 中文开发组
在GAE 中,

我如何生成 cookie,然后如何响应给 用户的请求呢?

我现在是这样生产的:

NEW_SID = sha.new(repr(time.time())).hexdigest()
cookie = Cookie.SimpleCookie()
cookie['sid'] = NEW_SID
cookie['sid']['expires'] = 24*60*60

请问这样对吗?

然后,如何把cookie 与页面内容一起响应给用户呢?

是直接把cookie 放到响应的html代码中吗?

Reply all
Reply to author
Forward
0 new messages