For example, I log in to my server. I want to store things like a username. Would the best way of going about it be:

self.set_secure_cookie('username', "foobar70")
有帮助吗?

解决方案

Just my oppinion. Secure cookies usually does good job to store data secure and works OK, if you need to store small data chunks, but passing lots of data back and forward with bigger cookies is annoying :) So the answer depends of your data volumes.

I usually use this implementation of sessions in Tornado, based on redis https://gist.github.com/1735032

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top