© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
7 replies
Spartan - Developer of Jupi

Weird issue with sessions using supabase python & django

I'm creating a web app using django and supabase for as the backend. My users login using email and password. However, the session created after login seems to be being shared across different browsers and machines. I think I'm doing or understanding something wrong because I'm expecting each logged in user to have a separate session. Right now, what happens is that when I log in a user, when I open the website on a totally different machine and I see that user is logged in on that other machine too. Super weird.

What am I missing here? Here's my simple login code for my view:

def login(request):

supabase: Client = Client(supabase_url, supabase_key)

if request.method == 'POST':
email = request.POST.get('email')
password = request.POST.get('password')

print(email)
print(password)

data = supabase.auth.sign_in_with_password({"email": email, "password": password})
user = data.user

if user:
res = supabase.auth.get_session()

return redirect('/') # Replace with the name of your success view
else:
messages.error(request, "Login failed. Please check your email and password.")

user_session = supabase.auth.get_session()
if user_session is None:
# If not a POST request or login failed, render the login form again
return render(request, 'login.html')
else:
return redirect('/')
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

supabase with python
SupabaseSSupabase / help-and-questions
4y ago
Upload file using python supabase client
SupabaseSSupabase / help-and-questions
4y ago
.rpc() with python supabase-client
SupabaseSSupabase / help-and-questions
4y ago
Custom info in supabase sessions
SupabaseSSupabase / help-and-questions
14mo ago