From: Malcolm Tredinnick <malc...@pointy-stick.com>
Date: Sun, 06 Apr 2008 13:17:31 +1000
Local: Sat, Apr 5 2008 11:17 pm
Subject: Re: django.contrib.sessions problems
On Sat, 2008-04-05 at 11:31 -0700, mrts wrote: [...] > Once Python 2.3/4 support will be dropped, we can start using It will be a while beyond that point, too, since you can't just > higher-grade hash algorithms from 2.5 hashlib throughout. But > this is offtopic for current discussion and will not happen in > the foreseeable future. magically rehash everything with the new algorithms. So you have to be able to read auth data generated with older algorithms. > The relationship between user and session Which would mean a user could only be logged in once each time. :-( > ----------------------------------------- > Associating some session data to logged-in users is a common use > Currently sessions and users are separated (I haven't checked how > I propose we add a "data bucket" to the user object that can be Session objects is the right place to store all session-related data. You'll need to elaborate more here on use-cases, I think. It might just > >>> u = authenticate(username=username, password=password) I don't see the need for an extra method here. Why isn't this just > >>> type(u.data) > <type 'dict'> > >>> u.data['foo'] = 'bar' > >>> u.save() # pickles the data dictionary and saves it in a text > # field > >>> u.data['foo'] > 'bar' > >>> logout(request) > >>> u.data > {} > It should be documented that all session data tied to a user > That would fix #6941. > I'm ready to implement this. > Clearing a session > Sessions should have a destroy() method that clears the keys and something logout() would do? It's easy to destroy a session. Just call delete() on the object (that's Regards, -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||