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 as
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 <[EMAI
> 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
> > database
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
> database:http://code.dja
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
> database:http://code.dja
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
> database:http://code.dja
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 5/
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
--~--~-~--~~~--
8 matches
Mail list logo