Open GoogleCodeExporter opened 9 years ago
I use datastore for storing sessions. Of couse I can use Datastore viewer to
clear Session king, but I want to do it in my Python code.
Original comment by nabokov.evgeni
on 10 Nov 2011 at 10:40
My solution. I created a fake kind "Session":
class Session(db.Model):
pass
Then call delete():
for s in Session.gql("").fetch(1000):
s.delete()
Original comment by nabokov.evgeni
on 10 Nov 2011 at 11:14
And then:
memcache.flush_all()
Original comment by nabokov.evgeni
on 10 Nov 2011 at 11:15
You could also use the ndb model:
from webapp2_extras.appengine.sessions_ndb import Session
for s in Session.query().fetch():
s.delete()
I think a more comprehensive solution would also allow for the removing of
expired / invalid sessions. Something that could be called from a cron job.
Original comment by kylefin...@gmail.com
on 17 Nov 2011 at 10:16
I would like to have a handler for this, to be scheduled via cron and taking
into account that one can have many sessions to be cleaned, so a single request
may not be sufficient.
I described it here, and I'm looking for contributions:
https://plus.google.com/u/0/b/110207997506115788259/110207997506115788259/posts/
EvTyDUqi85J
Original comment by rodrigo.moraes
on 18 Nov 2011 at 11:23
Original issue reported on code.google.com by
nabokov.evgeni
on 10 Nov 2011 at 10:38