clear sessionid through cookies using session_cookie_age

I want that when a user gets loggedin into a site then his sessionid is created when i use session_cookie_age which is declared in settings.py with that time if user is inactive for 10 mins then it gets automatically logged out but as i m storing sessionid in db so that sessionid is not getting cleared with session_cookie_age when user manually logs out then only its getting cleared.
So help me for this

Welcome @rinkiprasad11 !

See the docs for Clearing the session store and the clearsessions command.

We have it set up as a daily cron job.

Hi, I have used this below code in middleware and i got the expected output

class ClearExpiredSessionsMiddleware(MiddlewareMixin):
def process_response(self, request, response):
var = Session.objects.filter(expire_date__lte=datetime.now()).delete()
return response