def _delete_cookie(response):
 response.set_cookie(settings.SESSION_COOKIE_NAME, max_age=0, expires='Thu, 01-Jan-1970 00:00:00 GMT', domain=settings.SESSION_COOKIE_DOMAIN, secure=(settings.SESSION_COOKIE_SECURE or None), httponly=(settings.SESSION_COOKIE_HTTPONLY or None))

def _delete_cookie ( response ) : response . set_cookie ( settings . SESSION_COOKIE_NAME , max_age = 0 , expires = 'Thu, 01-Jan-1970 00:00:00 GMT' , domain = settings . SESSION_COOKIE_DOMAIN , secure = ( settings . SESSION_COOKIE_SECURE or None ) , httponly = ( settings . SESSION_COOKIE_HTTPONLY or None ) )
delete the cookie by setting the expiration to a date in the past .