#24819: Commands provided for clearsessions. It also clears the the last hour and minute session --------------------------------------+------------------------------------ Reporter: ghanshyam-rajpurohit | Owner: nobody Type: Bug | Status: new Component: contrib.sessions | Version: 1.8 Severity: Normal | Keywords: Session, clearsessions Triage Stage: Unreviewed | Has patch: 0 Easy pickings: 1 | UI/UX: 0 --------------------------------------+------------------------------------ [clearsessions]https://docs.djangoproject.com/en/1.8/ref/django-admin /#django-admin-
As while using the Commands provided for session as to clean out expired sessions. '''python manage.py clearsessions''' I have used the {{{ SESSION_ENGINE = "django.contrib.sessions.backends.db" }}} ''As to generate This bug.'' list all session object. in the db. {{{ from django.contrib.sessions.models import Session Session.objects.all() }}} take any one of the key from list. {{{ from django.contrib.sessions.models import Session import datetime sessgo = Session.objects.get(pk='session primary') sessgo.expire_date = sessgo.expire_date.replace(datetime.datetime.now().year, datetime.datetime.now().month,datetime.datetime.now().day, datetime.datetime.now().hour+1, datetime.datetime.now().minute) sessgo.save() sessgo.expire_date }}} now just run. '''python manage.py clearsessions''' and list again: {{{ Session.objects.all() }}} you will see the Session has been deleted even it has expire time after 1 hours. It works fine with year,month,day but it gets clear for the hour and minutes In above step I have done any wrong please let me know. -- Ticket URL: <https://code.djangoproject.com/ticket/24819> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/063.53b3f5fd5cd4eab707886a9bf537edd7%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.