Maybe something like: at the login you load this kind of data onto the user's session, after that just set/unset data in the session (that's on server's memory) and on session end you persist the data again on the database.
Avoid unecessary database hits and enable users to use multiple stations. [originally posted on jforum.net by smota]
It will not work well, because the session-timeout value. If I let to update user info only when its session expires, it will have a delay of x minutes, depending of how many minutes are set to the session-timeout.
Well, jforum does some data manipulation when an user enters. Basically, the SessionFacade checks for the upcoming username in the session's entries and, if he found one, it means that the user was gone for a while, but returned before the session-timeout ( but anyway, he haves a new session id ).
So, the facade removes the old entry and updates the session id. In this momment I can update the values in user's table.
For the rest, eg, for the people who left the site and doesn't return soon, I can update the database in sessionDestroyed() event.
hhmm.. maybe it work :-D
Rafael [originally posted on jforum.net by Rafael Steil]