Hi,
I log in a database when a user logs in and out. How do I know when R.O. has destroyed a session so I can write to the database when the “dead” session was logged out? what event am I looking for?
Thanks!
Hi,
I log in a database when a user logs in and out. How do I know when R.O. has destroyed a session so I can write to the database when the “dead” session was logged out? what event am I looking for?
Thanks!
Hello
There are 2 events exposed by the SessionManager:
OnSessionExpired
- raised after a session has been marked as expired right before this session is destroyedOnSessionDestroyed
- raised after a session has been destroyed for any reasonNote: It is not recommended to execute any long-running operations directly in the event handler code. SessionManager
calls these event handlers synchronously, so any long-running operation might pause execution of the session cleanup code.
You need to take care of both these events.
The OnSessionDestroyed
event will be raised when user performs a correct logout process, when server code calls the DestroySession
method.
The OnSessionExpired
event is raised when a session is killed due to a timeout. This might happen if
the clean logout process was not performed for any reason.