We're using django.contrib.sessions.backends.cache.  We use mongodb for our 
datastore, so we don't use the django model/database support at all.

The standard django session machinery generates 32-character hex strings 
(128 bits) for session ids.  We store the session_id in many places in our 
database (and index many collections on it), so shorter ids would be a big 
win.  Mongo uses 96-bits for its object ids.  I figure we don't need any 
more than that.  Base-64 encoding gives 16 characters.

So, the question is, is there any hook to allow us to generate our own 
session_ids for django.contrib.sessions.backends.cache to use?  I'm tempted 
to just subclass sessions.backends.cache and override 
_get_new_session_key(), but overriding underscore-prepended things sounds a 
little funky.

BTW, looking at base.py, why does it go to all the weird md5/pid/time 
stuff?  Why not just call uuid() and be done with it?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/foQbHzVBpq8J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to