Re: How to delete a session

2007-05-23 Thread urielka
just do this: from django.contrib.sessions.models import Session Session.objects.filter(session_key=request.session.session_key).delete() On May 23, 3:26 pm, Ramashish Baranwal <[EMAIL PROTECTED]> wrote: > Hi, > > How can I delete the session of a request? The docs speak about using > session

Re: How to delete a session

2007-05-23 Thread Joseph Heck
Ah - right. The middleware returns that all wrapped up. You can use the _session attribute on it to get down to the actual session object (I think - at least based on a quick glance through the code). So (I think) x=request.session._session x.delete() -joe On 5/23/07, Ramashish Baranwal

Re: How to delete a session

2007-05-23 Thread Ramashish Baranwal
> On May 23, 10:18 pm, "Joseph Heck" <[EMAIL PROTECTED]> wrote: > > > The session is a model in Django - so you can delete it like any other - > > > x=request.session > > x.delete() > > > There's also the daily_cleanup.py script included with Django that > > just goes straight to the > >

Re: How to delete a session

2007-05-23 Thread Ramashish Baranwal
On May 23, 10:18 pm, "Joseph Heck" <[EMAIL PROTECTED]> wrote: > The session is a model in Django - so you can delete it like any other - > > x=request.session > x.delete() > > There's also the daily_cleanup.py script included with Django that > just goes straight to the >

Re: How to delete a session

2007-05-23 Thread Ramashish Baranwal
On May 23, 10:18 pm, "Joseph Heck" <[EMAIL PROTECTED]> wrote: > The session is a model in Django - so you can delete it like any other - > > x=request.session > x.delete() > > There's also the daily_cleanup.py script included with Django that > just goes straight to the >

Re: How to delete a session

2007-05-23 Thread Joseph Heck
The session is a model in Django - so you can delete it like any other - x=request.session x.delete() There's also the daily_cleanup.py script included with Django that just goes straight to the database: http://code.djangoproject.com/browser/django/trunk/django/bin/daily_cleanup.py -joe On

How to delete a session

2007-05-23 Thread Ramashish Baranwal
Hi, How can I delete the session of a request? The docs speak about using session as a dict and setting and removing specific keys on that, but I want to remove the session itself, something like del request.session Any ideas? Thanks in advance, Ram