Hello people!
I know there are lots of threads with the same issue but I couldn't find a
proper and well solved solution.
I have a web application with users to login and logout.
If a user logs in the user object is hold in the session.
If the user logs out by using the logout button, the online status of this user
is set to "offline" in the database.
Well. My problem is the session timeout.
If a session timeout occurs I only can access the session id of the expired
session (am I right?).
So I'm not able to access the user object anymore (?).
Some of you showed a solution by holding a map or list in the application
class, e.g. key (sessionid) and value (user).
But I think it's expensive (memory).
It would be more performant to save the session id of the user in the user
database table when the user logs in.
When the timeout occurs I could retrieve the user object from the database by
using the unique session id.
Then I could modify the user object and make it persistent again.
Does anyone know a better way because I'm not fully satisfied with this
solution, too?
Best regards!
Allen