Michael Radziej wrote:
> > To go with the 80/20 rule, I'd imagine that for 80% of Django developers
> > something like this would work pretty well and be useful. [...]
>
> I don't think so.
>
> Isn't session cleanup a natural candidate for a cron job (and
> whatever is the equivalent in the Microsoft world)? I don't quite
> get the advantage of doing it inside the http request handlers.

I submitted a patch to the session docs to
(http://code.djangoproject.com/ticket/3137) adding in some language
that the sessions don't automatically purge expired sessions.  At the
least it should be in the documentation that this does or doesn't
happen and possibly point out the example "daily_clean.py" script as an
example of how to purge expired sessions if one wants to.

I've set up a few sites with Django and never really thought much about
sessions without that notice.  Now that I know, I'll go back and add in
the cron job.

I like the idea to optionally purge expired sessions.

The only benefit I see of putting it in with a request is that it
doesn't need an external script to do cleanup which may or may not be
forgotten about.  I'm used to PHP, which does this automatically, and
don't know much about how other frameworks handle session cleanup.

I'm curious, though... If you do have a high traffic site and your
session database fills up, aren't you then more likely to produce an
already existing session key.  Each one of those requires an extra
database call to check for previous existence.  The key space is huge,
though.  Something like 36^40?  In these bug comments, hugo said they
produce 1 million session keys with very few repeats
(http://code.djangoproject.com/ticket/1180).  So this probably
shouldn't be a worry, but I imagine a popular site running for years on
end with little maintenance and the session key space shrinking.


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to