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
I want to log the session time in the database for each user. So before they log out I want to do an insert with their ID and the session time. But I don't want to do this just when they click the logout button, but also when they leave the tab and come back, and when they refresh and see that their session has expired, I would need a beforeSignout event to handle this.
Proposal
I am very new to NextJs, it's my first month. So I don't have any idea of how this can be implemented. I searched a lot for an alternative but could not find it.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Goals
Non-Goals
Background
I want to log the session time in the database for each user. So before they log out I want to do an insert with their ID and the session time. But I don't want to do this just when they click the logout button, but also when they leave the tab and come back, and when they refresh and see that their session has expired, I would need a beforeSignout event to handle this.
Proposal
I am very new to NextJs, it's my first month. So I don't have any idea of how this can be implemented. I searched a lot for an alternative but could not find it.
Beta Was this translation helpful? Give feedback.
All reactions