I was wondering if there is a way to let the user remain logged in without having to sign in again if a user decides to close current tab and reopen it again. I am using Django and Python and here is the code I am using for signing in:
def postsign(request):
email = request.POST.get('email')
passw = request.POST.get("password")
try:
user = auth.sign_in_with_email_and_password(email,passw)
success = 1
except:
success = 0
message = "invalid cerediantials"
return render(request,"dashboard.html")
session_id = user['idToken']
request.session['uid'] = str(session_id)
context = {
"success": success,
"email": email,
}
return render(request, "dashboard.html", context)