我遇到了一個奇怪的問題: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 –