skariel / webalchemy

Modern web development with Python
MIT License
346 stars 21 forks source link

UUID as session id #145

Closed johngoodleaf closed 10 years ago

johngoodleaf commented 10 years ago

I notice we're using a random int here https://github.com/skariel/webalchemy/blob/master/webalchemy/server.py#L46-50

Would the uuid module be a better choice? (I haven't benchmarked to see how it performs relative to a straight random integer.) Even a random uuid, if not guaranteed unique, is practically unique.

skariel commented 10 years ago

done. as of 8e17fdd1762828dee58ba86446620e6d67fefb39 webalchemy uses a version 1 uuid as specified by RFC4122, see here: http://tools.ietf.org/html/rfc4122.html (this is just uuid1 from Pythons uuid package)