Last modified: Jan 10, 2023 By Alexander Williams
Checking if the Session exists in Django [Simple Method]
Today we'll learn how to check if a session is exists in django.
if session_key in request.session:
So we have already a session, this session has 'test' as a key and we want to check if this session exists.
if 'test' in request.session: print('yes!')