1👍
✅
You can set Expire time for session using set_expire function:
request.session.set_expiry(300)
You can validate session using is_authenticated function:
request.user.is_authenticated()
Source:stackexchange.com