我遇到了一个奇怪的问题:gaeutilities会话在GAE SDK上工作,但不在实际的Google App Engine平台上。以下是分别使用Python进行的会话创建和存在检查。gaeutilities'会话在SDK上运行,但不在Google应用引擎上运行?
Session创建:
self.session = sessions.Session()
self.session.delete_item('account')
self.session.delete_item('accountKey')
...
query = db.Query(model.Member)
query = query.filter('account =', account) # 'account' is the user account
results = query.fetch(limit=1)
if results: # Account exists
member = results[0]
self.session['account'] = account
self.session['accountKey'] = member.key()
...
会话生存确认:
self.session = sessions.Session()
if 'accountKey' in self.session: # Session exists
account = self.session['account'] # Could this be the problem?
...
上述程序运行在GAE SDK确定。但是我将该程序上传到Google App Engine,但没有奏效。可能是什么问题?
实际的错误是什么?也可以尝试检查“结果”的len而不是它的存在,因为(我似乎记得)它将返回一个空列表而不是一个空列表。 –
检查日志(不知道这意味着什么):过期时间:星期二,03七月2001 06:00:00 GMTLast-Modified:星期五,28 Dec 12 14:04:14 UTCCache-Control:no-store,no-cache,必须重新验证,max-age = 0Cache-Control:post-check = 0,pre-check = 0Pragma:no-cache –