HTTPRequestHandler.GetSessionId() - Determine if Session is Active?

HTTPRequestHandler.GetSessionId() - Determine if Session is Active?

  

This is for Web application, I am using HTTPRequestHandler.GetSessionId() to uniquely identify a session and persisting it in a database, I would like to know if there is any way to determine if these ids are active at later point of time. Basically I want to clean up the records in the Database if they are found inactive or invalid.


Thanks,

Raj

Hello Raj. You can use the Last_Login attribute form the User entity to know the last time the user logged in. Based on that information, you can decide whether to clean up the user's records.

Note that using the session id would give you some unexpected behaviors. For instance, when you close a browser, your session dies. If you reopen the app in a different browser, it does not restore your session - instead, if creates a new one. So you could end up deciding that a user is inactive, but in realitiy it just changed from one browser to another.