You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a user deletes the browser local storage session, new sessions are created in auth.sessions table for that users even if one already exists.
This PR #875 was added to cleanup the session tables.
I can see the cleanup SQL runs on every request. This is the SQL for the session table (there is similar SQL for the other tables) cleanup in this code
fmt.Sprintf("delete from %q where id in (select id from %q where not_after < now() - interval '72 hours' limit 10 for update skip locked);", tableSessions, tableSessions)
However the column not_after allows nulls and has nulls for the session data in the session table and I can't see in the code where it ever gets a value? So the cleanup will never happens?
This is where the column not_after was added which also said its not used PR #810
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Login using Supabase auth
Check session is created in auth.sessions table
Delete session data from browser local storage. This forces browser logout
Login again using same user
Check auth.sessions. There is 2 sessions for the same user.
Expected behavior
All related unused session/token data to be cleaned up/deleted from supabase. This also counts towards database storage.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
OS: Mac
Browser: Safari
Version of supabase-js: 2.25.0
Version of Node.js: 18.16.0
Additional context
I came across this because I was looking into how you could see what active sessions there is. Is there another way to do this?
The text was updated successfully, but these errors were encountered:
Bug report
Describe the bug
When a user deletes the browser local storage session, new sessions are created in auth.sessions table for that users even if one already exists.
This PR #875 was added to cleanup the session tables.
I can see the cleanup SQL runs on every request. This is the SQL for the session table (there is similar SQL for the other tables) cleanup in this code
fmt.Sprintf("delete from %q where id in (select id from %q where not_after < now() - interval '72 hours' limit 10 for update skip locked);", tableSessions, tableSessions)
However the column not_after allows nulls and has nulls for the session data in the session table and I can't see in the code where it ever gets a value? So the cleanup will never happens?
This is where the column not_after was added which also said its not used PR #810
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Expected behavior
All related unused session/token data to be cleaned up/deleted from supabase. This also counts towards database storage.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
Additional context
I came across this because I was looking into how you could see what active sessions there is. Is there another way to do this?
The text was updated successfully, but these errors were encountered: